From cfa74c1dc63851a29b50bbaa1b58f878a55107b9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 6 Jun 2011 18:50:39 +0200 Subject: string: Added missing errno. (cherry picked from commit d536cc4f399eabb0ca3dec5bf8b2bf2dc168bf60) --- src/string.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/string.c b/src/string.c index 1959ab6f..6268d001 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; } -- cgit