X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnetutl.c;h=f3ef1341246b9a8f6f0ce963f902161bfe6cd225;hp=f57266c3cc6c5017a7da438e897cfe5c9942ef1f;hb=3831f51a53088bfcc1d148fd54b3083afe7fde32;hpb=9acd4379f705edc8b736e21b9011434e63f7dd95 diff --git a/src/netutl.c b/src/netutl.c index f57266c3..f3ef1341 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: netutl.c,v 1.12.4.6 2000/06/29 17:09:06 guus Exp $ + $Id: netutl.c,v 1.12.4.7 2000/08/17 16:51:07 guus Exp $ */ #include "config.h" @@ -187,13 +187,11 @@ cp if(!lookup_hostname || !host) { - name = xmalloc(20); - sprintf(name, "%s", inet_ntoa(in)); + asprintf(&name, "%s", inet_ntoa(in)); } else { - name = xmalloc(strlen(host->h_name)+1); - sprintf(name, "%s", host->h_name); + asprintf(&name, "%s", host->h_name); } cp return name;