diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-03-21 16:55:07 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-03-21 16:55:07 +0100 |
| commit | 9e16f3439efd8581fa06dd4401f21a76f84c04b2 (patch) | |
| tree | 3147682dc31f7f071f40ecc17becb26fed3b816e /src | |
| parent | ff4cf80891ad0ca4064988200f06aa66b529bcdc (diff) | |
Fix MSVC 2010 warning/error: declare variables in C early
... before other code gets executed in a block. The warning or errors
generated were MORE than confusing.
Diffstat (limited to 'src')
| -rw-r--r-- | src/scandir_win32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scandir_win32.c b/src/scandir_win32.c index 2573fa395..874005bf2 100644 --- a/src/scandir_win32.c +++ b/src/scandir_win32.c @@ -47,10 +47,12 @@ static void get_ms_errmsg(char *errmsg, int errmsg_sz) { if ( msize == 0 ) { fl_snprintf(errmsg, errmsg_sz, "Error #%lu", (unsigned long)lastErr); } else { + char *src; + char *dst; /* convert message to UTF-8 */ fl_utf8fromwc(errmsg, errmsg_sz, mbuf, msize); /* Remove '\r's -- they screw up fl_alert()) */ - char *src = errmsg, *dst = errmsg; + src = dst = errmsg; for ( ; 1; src++ ) { if ( *src == '\0' ) { *dst = '\0'; break; } if ( *src != '\r' ) { *dst++ = *src; } |
