route6d.c (119032) | route6d.c (119033) |
---|---|
1/* $FreeBSD: head/usr.sbin/route6d/route6d.c 119032 2003-08-17 16:06:52Z ume $ */ | 1/* $FreeBSD: head/usr.sbin/route6d/route6d.c 119033 2003-08-17 16:07:57Z ume $ */ |
2/* $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 3246 unchanged lines hidden (view full) --- 3256 } 3257 return &ia; 3258} 3259 3260char * 3261allocopy(p) 3262 char *p; 3263{ | 2/* $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 3246 unchanged lines hidden (view full) --- 3256 } 3257 return &ia; 3258} 3259 3260char * 3261allocopy(p) 3262 char *p; 3263{ |
3264 char *q = (char *)malloc(strlen(p) + 1); | 3264 int len = strlen(p) + 1; 3265 char *q = (char *)malloc(len); |
3265 | 3266 |
3266 strcpy(q, p); | 3267 if (!q) { 3268 fatal("malloc"); 3269 /*NOTREACHED*/ 3270 } 3271 3272 strlcpy(q, p, len); |
3267 return q; 3268} 3269 3270char * 3271hms() 3272{ 3273 static char buf[BUFSIZ]; 3274 time_t t; --- 194 unchanged lines hidden --- | 3273 return q; 3274} 3275 3276char * 3277hms() 3278{ 3279 static char buf[BUFSIZ]; 3280 time_t t; --- 194 unchanged lines hidden --- |