mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-05 04:40:31 +09:00
Fix segfaults in string.c.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@311 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -49,7 +49,6 @@ struct string_struct *string_new(size_t size) {
|
||||
if (str == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ZERO_STRUCTP(str);
|
||||
|
||||
str->size = htonl(size);
|
||||
return str;
|
||||
@@ -103,7 +102,7 @@ struct string_struct *string_from_char(const char *what) {
|
||||
*/
|
||||
size_t string_len(struct string_struct *s) {
|
||||
if (s == NULL) {
|
||||
return 0;
|
||||
return ntohl(0);
|
||||
}
|
||||
|
||||
return ntohl(s->size);
|
||||
|
||||
Reference in New Issue
Block a user