diff options
| author | Theo Buehler <tb@openbsd.org> | 2026-07-09 05:08:13 +0200 |
|---|---|---|
| committer | Theo Buehler <tb@openbsd.org> | 2026-07-09 05:08:13 +0200 |
| commit | a5178f345d343287eec33d422751b15e2fb58b30 (patch) | |
| tree | d858bddb32b88f8c8bd57634a45fbd909fb65114 | |
| parent | b98f3b47a34fde75c64e0ed914bb82dae8bbfc5c (diff) | |
| parent | af20f7bf0441419acd58ea0bf00db86bfa4cdb41 (diff) | |
| download | portable-a5178f345d343287eec33d422751b15e2fb58b30.tar.gz portable-a5178f345d343287eec33d422751b15e2fb58b30.tar.bz2 portable-a5178f345d343287eec33d422751b15e2fb58b30.zip | |
Land #1315 - handle GetModuleFileName failure
| -rw-r--r-- | crypto/compat/getprogname_windows.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/compat/getprogname_windows.c b/crypto/compat/getprogname_windows.c index eb04ec0..9de3cab 100644 --- a/crypto/compat/getprogname_windows.c +++ b/crypto/compat/getprogname_windows.c | |||
| @@ -7,7 +7,8 @@ getprogname(void) | |||
| 7 | { | 7 | { |
| 8 | static char progname[MAX_PATH + 1]; | 8 | static char progname[MAX_PATH + 1]; |
| 9 | DWORD length = GetModuleFileName(NULL, progname, sizeof (progname) - 1); | 9 | DWORD length = GetModuleFileName(NULL, progname, sizeof (progname) - 1); |
| 10 | if (length < 0) | 10 | if (length == 0) |
| 11 | return "?"; | 11 | return "?"; |
| 12 | progname[length] = '\0'; | ||
| 12 | return progname; | 13 | return progname; |
| 13 | } | 14 | } |
