mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-31 15:05:46 +03:00
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:
1 parent
a061428eb6
commit
8423ebbe8b
1 file changed
+1
-2
+1
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user