From: Art Cancro Date: Thu, 19 Apr 2012 15:39:59 +0000 (-0400) Subject: Remove unused variable X-Git-Tag: v8.11~85 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=95b5731df2cba58a7f1e6f7827106ce08dd2de15 Remove unused variable --- diff --git a/citadel/textclient/commands.c b/citadel/textclient/commands.c index 98be7a698..e6cbffc77 100644 --- a/citadel/textclient/commands.c +++ b/citadel/textclient/commands.c @@ -575,8 +575,9 @@ void strprompt(char *prompt, char *str, int len) scr_printf(": "); color(BRIGHT_CYAN); ctdl_getline(buf, len); - if (buf[0] != 0) + if (buf[0] != 0) { strcpy(str, buf); + } color(DIM_WHITE); } @@ -636,6 +637,7 @@ int intprompt(char *prompt, int ival, int imin, int imax) */ void newprompt(char *prompt, char *str, int len) { + str[0] = 0; color(BRIGHT_MAGENTA); scr_printf("%s", prompt); color(DIM_MAGENTA); @@ -1054,6 +1056,7 @@ int getcmd(CtdlIPC *ipc, char *argbuf) if (cmdmatch(cmdbuf, cptr, 5)) { /* We've found our command. */ if (requires_string(cptr, cmdpos)) { + argbuf[0] = 0; ctdl_getline(argbuf, 64); } else { scr_printf("\n"); diff --git a/citadel/utils/chkpw.c b/citadel/utils/chkpw.c index b0f0d5885..227064638 100644 --- a/citadel/utils/chkpw.c +++ b/citadel/utils/chkpw.c @@ -114,7 +114,6 @@ int main(int argc, char **argv) { struct passwd *p; int uid; char ctdldir[PATH_MAX]=CTDLDIR; - char *ptr = NULL; calc_dirs_n_files(0,0,"", ctdldir, 0); @@ -127,7 +126,7 @@ int main(int argc, char **argv) { } while(1) { printf("\n\nUsername: "); - ptr = fgets(buf, sizeof buf, stdin); + fgets(buf, sizeof buf, stdin); buf[strlen(buf)-1] = 0; p = getpwnam(buf); if (p == NULL) { @@ -137,7 +136,7 @@ int main(int argc, char **argv) { uid = p->pw_uid; printf(" uid: %d\n", uid); printf("Password: "); - ptr = fgets(buf, sizeof buf, stdin); + fgets(buf, sizeof buf, stdin); buf[strlen(buf)-1] = 0; validpw(uid, buf); }