diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 21:03:51 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 21:03:51 +0000 |
commit | 8c1aaf32978da33a462997b269536f1de47c79c6 (patch) | |
tree | e7cb06194cb1feaa823abf61977bc64b2024d3bb | |
parent | 3c8b5ba8e82363c1fd8f58260b4470a96285cd21 (diff) | |
download | busybox-w32-8c1aaf32978da33a462997b269536f1de47c79c6.tar.gz busybox-w32-8c1aaf32978da33a462997b269536f1de47c79c6.tar.bz2 busybox-w32-8c1aaf32978da33a462997b269536f1de47c79c6.zip |
snprintf(... "%s"...) => safe_strncpy
-rw-r--r-- | networking/libiproute/utils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index 7fc1dbc26..a0d08246a 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c | |||
@@ -316,9 +316,12 @@ const char *format_host(int af, int len, void *addr, char *buf, int buflen) | |||
316 | default:; | 316 | default:; |
317 | } | 317 | } |
318 | } | 318 | } |
319 | if (len > 0 && (h_ent = gethostbyaddr(addr, len, af)) != NULL) { | 319 | if (len > 0) { |
320 | snprintf(buf, buflen - 1, "%s", h_ent->h_name); | 320 | h_ent = gethostbyaddr(addr, len, af); |
321 | return buf; | 321 | if (h_ent != NULL) { |
322 | safe_strncpy(buf, h_ent->h_name, buflen); | ||
323 | return buf; | ||
324 | } | ||
322 | } | 325 | } |
323 | } | 326 | } |
324 | #endif | 327 | #endif |