Mercurial > hg > nnchat
changeset 143:5babbff7ca26
Rename some variables, cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Nov 2010 21:51:10 +0200 |
parents | 0b9910c3ed30 |
children | 1ba67be3ea3c |
files | nnchat.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 */