X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinmisc.c;h=f2e4f223595b4b73d642df1648223f282583d85a;hb=21101c7397e460933635a7bfed813864fc4f88fe;hp=cd8d74ed1fdbfb76f1e6f02ffc01cdddf5d33011;hpb=1f6504c2de427b0db6267fe7e93ace626970c287;p=PuTTY.git diff --git a/windows/winmisc.c b/windows/winmisc.c index cd8d74ed..f2e4f223 100644 --- a/windows/winmisc.c +++ b/windows/winmisc.c @@ -71,6 +71,13 @@ Filename *filename_deserialise(void *vdata, int maxsize, int *used) return filename_from_str(data); } +char filename_char_sanitise(char c) +{ + if (strchr("<>:\"/\\|?*", c)) + return '.'; + return c; +} + #ifndef NO_SECUREZEROMEMORY /* * Windows implementation of smemclr (see misc.c) using SecureZeroMemory. @@ -222,8 +229,8 @@ const char *win_strerror(int error) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), msgtext, lenof(msgtext)-1, NULL)) { sprintf(msgtext, - "(unable to format: FormatMessage returned %d)", - GetLastError()); + "(unable to format: FormatMessage returned %u)", + (unsigned int)GetLastError()); } else { int len = strlen(msgtext); if (len > 0 && msgtext[len-1] == '\n')