diff options
Diffstat (limited to 'bufaux.c')
-rw-r--r-- | bufaux.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufaux.c,v 1.50 2010/08/31 09:58:37 djm Exp $ */ | 1 | /* $OpenBSD: bufaux.c,v 1.52 2013/07/12 00:19:58 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -181,7 +181,7 @@ buffer_get_string_ret(Buffer *buffer, u_int *length_ptr) | |||
181 | /* Get the string. */ | 181 | /* Get the string. */ |
182 | if (buffer_get_ret(buffer, value, len) == -1) { | 182 | if (buffer_get_ret(buffer, value, len) == -1) { |
183 | error("buffer_get_string_ret: buffer_get failed"); | 183 | error("buffer_get_string_ret: buffer_get failed"); |
184 | xfree(value); | 184 | free(value); |
185 | return (NULL); | 185 | return (NULL); |
186 | } | 186 | } |
187 | /* Append a null character to make processing easier. */ | 187 | /* Append a null character to make processing easier. */ |
@@ -216,7 +216,7 @@ buffer_get_cstring_ret(Buffer *buffer, u_int *length_ptr) | |||
216 | error("buffer_get_cstring_ret: string contains \\0"); | 216 | error("buffer_get_cstring_ret: string contains \\0"); |
217 | else { | 217 | else { |
218 | bzero(ret, length); | 218 | bzero(ret, length); |
219 | xfree(ret); | 219 | free(ret); |
220 | return NULL; | 220 | return NULL; |
221 | } | 221 | } |
222 | } | 222 | } |
@@ -285,7 +285,7 @@ buffer_put_cstring(Buffer *buffer, const char *s) | |||
285 | * Returns a character from the buffer (0 - 255). | 285 | * Returns a character from the buffer (0 - 255). |
286 | */ | 286 | */ |
287 | int | 287 | int |
288 | buffer_get_char_ret(char *ret, Buffer *buffer) | 288 | buffer_get_char_ret(u_char *ret, Buffer *buffer) |
289 | { | 289 | { |
290 | if (buffer_get_ret(buffer, ret, 1) == -1) { | 290 | if (buffer_get_ret(buffer, ret, 1) == -1) { |
291 | error("buffer_get_char_ret: buffer_get_ret failed"); | 291 | error("buffer_get_char_ret: buffer_get_ret failed"); |
@@ -297,11 +297,11 @@ buffer_get_char_ret(char *ret, Buffer *buffer) | |||
297 | int | 297 | int |
298 | buffer_get_char(Buffer *buffer) | 298 | buffer_get_char(Buffer *buffer) |
299 | { | 299 | { |
300 | char ch; | 300 | u_char ch; |
301 | 301 | ||
302 | if (buffer_get_char_ret(&ch, buffer) == -1) | 302 | if (buffer_get_char_ret(&ch, buffer) == -1) |
303 | fatal("buffer_get_char: buffer error"); | 303 | fatal("buffer_get_char: buffer error"); |
304 | return (u_char) ch; | 304 | return ch; |
305 | } | 305 | } |
306 | 306 | ||
307 | /* | 307 | /* |