# HG changeset patch # User Matti Hamalainen # Date 1288727470 -7200 # Node ID 5babbff7ca2661bb8592856142609ca27206c44a # Parent 0b9910c3ed3038d325ac3a2b074050eeee48044e Rename some variables, cleanups. diff -r 0b9910c3ed30 -r 5babbff7ca26 nnchat.c --- a/nnchat.c Tue Nov 02 21:50:49 2010 +0200 +++ b/nnchat.c Tue Nov 02 21:51:10 2010 +0200 @@ -602,16 +602,17 @@ return 0; } else if (!strncasecmp(buf, "/save", 5)) { /* Save configuration */ - FILE *f = fopen(setConfigFile, "w"); - if (f == NULL) { - printMsg("Could not save configuration to file '%s'!\n", setConfigFile); + FILE *cfgfile = fopen(setConfigFile, "w"); + if (cfgfile == NULL) { + printMsg("Could not create configuration to file '%s': %s\n", setConfigFile, + strerror(errno)); return 0; } printMsg("Configuration saved in file '%s', res=%d\n", setConfigFile, - th_cfg_write(f, setConfigFile, cfg)); + th_cfg_write(cfgfile, setConfigFile, cfg)); - fclose(f); + fclose(cfgfile); return 0; } else if (!strncasecmp(buf, "/w ", 3)) { /* Open given username's profile via firefox in a new tab */