diff options
Diffstat (limited to 'server/common.c')
-rw-r--r-- | server/common.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/server/common.c b/server/common.c index b668ef8..fd44f38 100644 --- a/server/common.c +++ b/server/common.c @@ -25,25 +25,22 @@ static const char rcsid_common_c[] = /* copy a string into a newly allocated area */ char * -strsave (sp) - const char *sp; +strsave (const char *sp) { char *ret; - ret = (char *) malloc(strlen(sp) + 1); + ret = strdup(sp); if (!ret) { syslog(LOG_CRIT, "no mem strdup'ing"); abort(); } - strcpy(ret, sp); return ret; } /* The "& 0x5f" provides case-insensitivity for ASCII. */ unsigned long -hash(string) - const char *string; +hash(const char *string) { unsigned long hval = 0; char cp; @@ -82,9 +79,7 @@ hash(string) } /* Output a name, replacing newlines with \n and single quotes with \q. */ -void dump_quote(p, fp) - char *p; - FILE *fp; +void dump_quote(char *p, FILE *fp) { for (; *p; p++) { if (*p == '\'') { |