diff options
author | Will Song <incertia9474@gmail.com> | 2015-11-23 20:43:42 -0600 |
---|---|---|
committer | Will Song <incertia9474@gmail.com> | 2015-11-23 20:43:42 -0600 |
commit | 8b9b06c24fbdb4bc2b6ddba1c0639421dd20a316 (patch) | |
tree | fca913e6066450900f4f1ca2bb4669715a4728b6 | |
parent | ddd5ce857d58f1da36a53fc867a80dcbe094663a (diff) | |
download | profani-tty-8b9b06c24fbdb4bc2b6ddba1c0639421dd20a316.tar.gz |
ignore another return value and move initial loop declaration outside of loop
-rw-r--r-- | src/command/commands.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 2d76aeda..4605e5f7 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -804,7 +804,8 @@ writecsv(int fd, const char *const str){ size_t len = strlen(str); char *s = malloc(2 * len * sizeof(char)); char *c = s; - for(int i = 0; i < strlen(str); i++){ + int i = 0; + for(; i < strlen(str); i++){ if(str[i] != '"') *c++ = str[i]; else { *c++ = '"'; *c++ = '"'; len++; } } @@ -827,8 +828,10 @@ cmd_export(ProfWin *window, const char *const command, gchar **args) cons_show(""); return TRUE; } + int unused; + (void)(unused); - write(fd, "jid,name\n", strlen("jid,name\n")); + unused = write(fd, "jid,name\n", strlen("jid,name\n")); list = roster_get_contacts(ROSTER_ORD_NAME, TRUE); if(list){ GSList *curr = list; @@ -836,8 +839,6 @@ cmd_export(ProfWin *window, const char *const command, gchar **args) PContact contact = curr->data; const char *jid = p_contact_barejid(contact); const char *name = p_contact_name(contact); - int unused; - (void)(unused); /* write the data to the file */ unused = write(fd, "\"", 1); |