| 44 |
|
#endif |
| 45 |
|
|
| 46 |
|
|
| 47 |
– |
char * |
| 48 |
– |
xstrldup(const char *s, size_t n) |
| 49 |
– |
{ |
| 50 |
– |
size_t len = strlen(s) + 1; |
| 51 |
– |
char *p = NULL; |
| 52 |
– |
|
| 53 |
– |
if (len > n) |
| 54 |
– |
len = n; |
| 55 |
– |
return strlcpy((p = malloc(len)), s, len), p; |
| 56 |
– |
} |
| 57 |
– |
|
| 47 |
|
/* |
| 48 |
|
* myctime - This is like standard ctime()-function, but it zaps away |
| 49 |
|
* the newline from the end of that string. Also, it takes |
| 328 |
|
* to use pointer overlays. All the world's not a VAX. |
| 329 |
|
*/ |
| 330 |
|
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; |
| 331 |
< |
struct { int base, len; } best, cur; |
| 331 |
> |
struct { int base, len; } best = {0,0}, cur = {0,0}; |
| 332 |
|
unsigned int words[IN6ADDRSZ / INT16SZ]; |
| 333 |
|
int i; |
| 334 |
|
|