diff options
author | Karl Ramm <kcr@mit.edu> | 2008-01-21 03:11:00 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2008-01-21 03:11:00 +0000 |
commit | 6ff9e17ef29f984a45a1b9dd4ece890aef7f5439 (patch) | |
tree | 92e45f2302c6409544aac2ee26f4f4a47913c187 /server/common.c | |
parent | b922241047b036cac6c0431faa6305b0f7b9ff2e (diff) |
de K&Rify
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 == '\'') { |