summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-06-06 18:50:39 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-06-06 18:51:12 +0200
commitcfa74c1dc63851a29b50bbaa1b58f878a55107b9 (patch)
tree843f3bcc8c74315a93f143e70e682781b8747c46
parentde706de8c3f67ae8408b2c8be139d177ef5d567c (diff)
downloadlibssh-cfa74c1dc63851a29b50bbaa1b58f878a55107b9.tar.gz
libssh-cfa74c1dc63851a29b50bbaa1b58f878a55107b9.tar.xz
libssh-cfa74c1dc63851a29b50bbaa1b58f878a55107b9.zip
string: Added missing errno.
(cherry picked from commit d536cc4f399eabb0ca3dec5bf8b2bf2dc168bf60)
-rw-r--r--src/string.c5
1 files 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;
}