diff options
-rw-r--r-- | src/string.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/string.c b/src/string.c index 1959ab6..6268d00 100644 --- a/src/string.c +++ b/src/string.c @@ -91,10 +91,11 @@ int ssh_string_fill(struct ssh_string_struct *s, const void *data, size_t len) { * @note The nul byte is not copied nor counted in the ouput string. */ struct ssh_string_struct *ssh_string_from_char(const char *what) { - struct ssh_string_struct *ptr = NULL; + struct ssh_string_struct *ptr; size_t len; - + if(what == NULL) { + errno = EINVAL; return NULL; } |