]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
netrc: fix pointer to bool conversion
authorViktor Szakats <commit@vsz.me>
Sun, 17 Nov 2024 11:46:25 +0000 (12:46 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 17 Nov 2024 12:18:00 +0000 (13:18 +0100)
with MSVC 2008 and 2010:
```
lib/netrc.c(107): error C2440: 'initializing' : cannot convert from 'char *' to 'bool'
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/jtoxd4mk984oi6fd#L164
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/0wxlw9a8g04e56vt#L177

Follow-up to e9b9bbac22c26cf67316fa8e6c6b9e831af31949 #15586
Closes #15601

lib/netrc.c

index e787a6ffcaa24d3923fc1bec9f3a0b20f3c2e26a..d5ee3c0fd564a8ad2a50c5dcf9183989e90dc9d2 100644 (file)
@@ -104,7 +104,7 @@ static int parsenetrc(struct store_netrc *store,
   int retcode = NETRC_FILE_MISSING;
   char *login = *loginp;
   char *password = NULL;
-  bool specific_login = login; /* points to something */
+  bool specific_login = !!login; /* points to something */
   enum host_lookup_state state = NOTHING;
   enum found_state keyword = NONE;
   unsigned char found = 0; /* login + password found bits, as they can come in