version 1.5, 1997/05/30 23:35:53 |
version 1.6, 1997/06/02 21:33:28 |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/file.h> |
#include <sys/file.h> |
|
#include <err.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <ctype.h> |
|
|
#include <paths.h> |
#include <paths.h> |
#include <errno.h> |
#include <errno.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <vis.h> |
#include "finger.h" |
#include "finger.h" |
#include "extern.h" |
#include "extern.h" |
|
|
|
|
*p++ = *num++; |
*p++ = *num++; |
*p = '\0'; |
*p = '\0'; |
return(pbuf); |
return(pbuf); |
|
} |
|
|
|
/* Like strvis(), but use malloc() to get the space and return a pointer |
|
* to the beginning of the converted string, not the end. |
|
* |
|
* Recycle the malloc()ed area on each call. This leads to a leak which |
|
* does not grow. |
|
*/ |
|
char * |
|
vs(src) |
|
char *src; |
|
{ |
|
static char *dst = NULL; |
|
|
|
if (dst != NULL) |
|
free(dst); |
|
if ((dst = malloc((4 * strlen(src)) + 1)) == NULL) |
|
err(1, "malloc failed"); |
|
|
|
strvis(dst, src, VIS_SAFE|VIS_NOSLASH); |
|
return(dst); |
} |
} |