summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-20 05:18:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-20 05:18:26 +0000
commitdb7c17d71cacfc5af407f4e30ddbc409ecd03112 (patch)
tree1cb761c6c0dc1bbf9223f465a115416edfa3aa7e /win32
parent0c1a8ec7bddcb61a4b45cf947cb375e7d350aaa6 (diff)
downloadperl-db7c17d71cacfc5af407f4e30ddbc409ecd03112.tar.gz
various little nits
p4raw-id: //depot/perl@3436
Diffstat (limited to 'win32')
-rw-r--r--win32/perlhost.h7
-rw-r--r--win32/win32.c13
2 files changed, 12 insertions, 8 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 458ff9afc9..e52ba6d419 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -593,9 +593,10 @@ public:
}
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());
}
};
virtual void FreeBuf(char* sMsg)
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);
}