Skip to content

Commit 8fb359a

Browse files
committed
Replace all control characters with spaces that FormatMessage function might generate
1 parent 2f26d35 commit 8fb359a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

svcbatch.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -881,17 +881,17 @@ static BOOL xwinapierror(LPWSTR buf, int siz, DWORD err)
881881
if (n) {
882882
do {
883883
buf[n--] = WNUL;
884-
} while ((n > 0) && ((buf[n] == L'.') || iswspace(buf[n])));
884+
} while ((n > 0) && ((buf[n] == 46) || (buf[n] < 33)));
885885

886886
while (n-- > 0) {
887-
if (iswspace(buf[n]))
888-
buf[n] = L' ';
887+
if (buf[n] < 32)
888+
buf[n] = 32;
889889
}
890890
return TRUE;
891891
}
892892
else {
893893
xsnwprintf(buf, siz,
894-
L"Unknown system error code: %u", err);
894+
L"Unrecognized system error code: %u", err);
895895
return FALSE;
896896
}
897897
}

0 commit comments

Comments
 (0)