client.c: allow empty user names

Zero-length strings passed to -u are valid user names for DTLS.
The function cmdline_read_user() therefore returns 0 when the
argument passed with option '-u' is an empty string.
This commit is contained in:
Olaf Bergmann committed 2017-08-02 21:17:07 +02:00
1 parent a061428eb6
commit 8423ebbe8b
1 file changed
+1 -2
+1 -2
View File
@@ -1023,9 +1023,8 @@ cmdline_read_user(char *arg, unsigned char *buf, size_t maxlen) {
size_t len = strnlen(arg, maxlen);
if (len) {
memcpy(buf, arg, len);
return len;
}
return -1;
return len;
}
static ssize_t