diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-20 05:18:26 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-20 05:18:26 +0000 |
commit | db7c17d71cacfc5af407f4e30ddbc409ecd03112 (patch) | |
tree | 1cb761c6c0dc1bbf9223f465a115416edfa3aa7e /win32/win32.c | |
parent | 0c1a8ec7bddcb61a4b45cf947cb375e7d350aaa6 (diff) | |
download | perl-db7c17d71cacfc5af407f4e30ddbc409ecd03112.tar.gz |
various little nits
p4raw-id: //depot/perl@3436
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/win32/win32.c b/win32/win32.c index 2fe8772d65..53048cb200 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1716,12 +1716,15 @@ win32_str_os_error(void *sv, DWORD dwErr) } if (0 == dwLen) { sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/); - dwLen = sprintf(sMsg, - "Unknown error #0x%lX (lookup 0x%lX)", - dwErr, GetLastError()); + if (sMsg) + dwLen = sprintf(sMsg, + "Unknown error #0x%lX (lookup 0x%lX)", + dwErr, GetLastError()); + } + if (sMsg) { + sv_setpvn((SV*)sv, sMsg, dwLen); + LocalFree(sMsg); } - sv_setpvn((SV*)sv, sMsg, dwLen); - LocalFree(sMsg); } |