Changeset c6b1782


Ignore:
Timestamp:
Feb 4, 2011, 3:49:44 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
e3c8332
Parents:
0290b2a
git-author:
David Benjamin <davidben@mit.edu> (01/24/11 23:51:28)
git-committer:
David Benjamin <davidben@mit.edu> (02/04/11 15:49:44)
Message:
Use g_strjoinv in parsing zwrite lines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zwrite.c

    r719119de rc6b1782  
    1717int owl_zwrite_create_from_line(owl_zwrite *z, const char *line)
    1818{
    19   int argc, badargs, myargc, i, len;
     19  int argc, badargs, myargc;
    2020  char **argv;
    2121  const char *const *myargv;
     
    105105      myargv++;
    106106      myargc--;
    107       len = 0;
    108       for (i=0;i<myargc;i++) {
    109         len += strlen(myargv[i]) + 1;
    110       }
    111       len++;    /* NULL after the last trailing ' ' in the loop below. */
    112       msg = owl_malloc(len);
    113       msg[0] = '\0';
    114       while (myargc) {
    115         strcat(msg, myargv[0]);
    116         strcat(msg, " ");
    117         myargc--;
    118         myargv++;
    119       }
    120       msg[strlen(msg)-1] = '\0';
     107      msg = g_strjoinv(" ", (char**)myargv);
    121108      break;
    122109    } else if (!strcmp(myargv[0], "-C")) {
Note: See TracChangeset for help on using the changeset viewer.