Mercurial > hg > nnchat
comparison nnchat.c @ 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 |
comparison
equal
deleted
inserted
replaced
142:0b9910c3ed30 | 143:5babbff7ca26 |
---|---|
600 printMsgC("\n"); | 600 printMsgC("\n"); |
601 } | 601 } |
602 return 0; | 602 return 0; |
603 } else if (!strncasecmp(buf, "/save", 5)) { | 603 } else if (!strncasecmp(buf, "/save", 5)) { |
604 /* Save configuration */ | 604 /* Save configuration */ |
605 FILE *f = fopen(setConfigFile, "w"); | 605 FILE *cfgfile = fopen(setConfigFile, "w"); |
606 if (f == NULL) { | 606 if (cfgfile == NULL) { |
607 printMsg("Could not save configuration to file '%s'!\n", setConfigFile); | 607 printMsg("Could not create configuration to file '%s': %s\n", setConfigFile, |
608 strerror(errno)); | |
608 return 0; | 609 return 0; |
609 } | 610 } |
610 printMsg("Configuration saved in file '%s', res=%d\n", | 611 printMsg("Configuration saved in file '%s', res=%d\n", |
611 setConfigFile, | 612 setConfigFile, |
612 th_cfg_write(f, setConfigFile, cfg)); | 613 th_cfg_write(cfgfile, setConfigFile, cfg)); |
613 | 614 |
614 fclose(f); | 615 fclose(cfgfile); |
615 return 0; | 616 return 0; |
616 } else if (!strncasecmp(buf, "/w ", 3)) { | 617 } else if (!strncasecmp(buf, "/w ", 3)) { |
617 /* Open given username's profile via firefox in a new tab */ | 618 /* Open given username's profile via firefox in a new tab */ |
618 char *name = trimLeft(buf + 3); | 619 char *name = trimLeft(buf + 3); |
619 | 620 |