comparison src/peopen.c @ 27:3654c502a4df

g_malloc terminates the program on failure automatically
author meillo@marmaro.de
date Thu, 06 May 2010 11:50:40 +0200
parents f671821d8222
children 7cdd30429cc9
comparison
equal deleted inserted replaced
26:607221b0dac1 27:3654c502a4df
31 char buf[strlen(cmd) + 1]; 31 char buf[strlen(cmd) + 1];
32 char **arr, *q; 32 char **arr, *q;
33 const char *p; 33 const char *p;
34 int i = 0; 34 int i = 0;
35 35
36 arr = (char **) malloc(sizeof(char *) * count); 36 arr = (char **) g_malloc(sizeof(char *) * count);
37 /* FIXME: check return value of malloc() */
38 37
39 p = cmd; 38 p = cmd;
40 while (*p && i < (count - 1)) { 39 while (*p && i < (count - 1)) {
41 while (*p && isspace(*p)) 40 while (*p && isspace(*p))
42 p++; 41 p++;