mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-31 06:55:47 +03:00
Merge pull request #569 from mrdeep1/cmdline_read_user
cmdline_read_user: Fix NULL terminating code
This commit is contained in:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1306,7 +1306,7 @@ cmdline_read_user(char *arg, unsigned char **buf, size_t maxlen) {
|
||||
if (len) {
|
||||
*buf = (unsigned char *)arg;
|
||||
/* len is the size or less, so 0 terminate to maxlen */
|
||||
buf[len] = '\000';
|
||||
(*buf)[len] = '\000';
|
||||
}
|
||||
/* 0 length Identity is valid */
|
||||
return len;
|
||||
|
||||
@@ -2222,7 +2222,7 @@ cmdline_read_user(char *arg, unsigned char **buf, size_t maxlen) {
|
||||
if (len) {
|
||||
*buf = (unsigned char *)arg;
|
||||
/* len is the size or less, so 0 terminate to maxlen */
|
||||
buf[len] = '\000';
|
||||
(*buf)[len] = '\000';
|
||||
}
|
||||
/* 0 length Identity is valid */
|
||||
return len;
|
||||
|
||||
Reference in new issue
Block a user