From: mar Date: Thu, 7 Sep 1989 14:10:43 +0000 (+0000) Subject: make "none" delete a phone number X-Git-Tag: ASRSNAP1001~43 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/1603d7ed5097d18d60275efa0e88a51b66d01118 make "none" delete a phone number --- diff --git a/clients/passwd/chfn.c b/clients/passwd/chfn.c index f0e7aef9..8744a97f 100644 --- a/clients/passwd/chfn.c +++ b/clients/passwd/chfn.c @@ -291,13 +291,13 @@ char *ask(question, def_val, phone_num) } if (phone_num && ok) { - for (i = 0; i < strlen(buf); i++) { - if (!isdigit(buf[i]) && (buf[i] != '-')) { + for (i = 0; i < strlen(result); i++) { + if (!isdigit(result[i]) && (result[i] != '-')) { printf("Phone numbers can contain only digits.\n"); ok = FALSE; break; } - if (buf[i] == '-') + if (result[i] == '-') dashes = TRUE; } }