comparison toys/pending/fsck.c @ 1183:0752b2d58909 draft

Rename xmsprintf() to just xmprintf(). Partly because there's no supplied target string ala sprintf, and partly because I can never remember what order the m and s go in.
author Rob Landley <rob@landley.net>
date Thu, 16 Jan 2014 09:26:50 -0600
parents 36a3a6f55154
children 0ecfaa7022e8
comparison
equal deleted inserted replaced
1182:7079ea384a2e 1183:0752b2d58909
196 && strncmp(TT.t_list, "opts=", 5) && strncmp(TT.t_list , "loop", 4) 196 && strncmp(TT.t_list, "opts=", 5) && strncmp(TT.t_list , "loop", 4)
197 && !TT.arr_type[1]) type = TT.t_list; //one file sys at cmdline 197 && !TT.arr_type[1]) type = TT.t_list; //one file sys at cmdline
198 else type = "auto"; 198 else type = "auto";
199 199
200 args = xzalloc((toys.optc + 2 + 1 + 1) * sizeof(char*)); //+1, for NULL, +1 if -C 200 args = xzalloc((toys.optc + 2 + 1 + 1) * sizeof(char*)); //+1, for NULL, +1 if -C
201 args[0] = xmsprintf("fsck.%s", type); 201 args[0] = xmprintf("fsck.%s", type);
202 202
203 if(toys.optflags & FLAG_C) args[i++] = xmsprintf("%s %d","-C", TT.fd_num); 203 if(toys.optflags & FLAG_C) args[i++] = xmprintf("%s %d","-C", TT.fd_num);
204 while(toys.optargs[j]) { 204 while(toys.optargs[j]) {
205 if(*toys.optargs[j]) args[i++] = xstrdup(toys.optargs[j]); 205 if(*toys.optargs[j]) args[i++] = xstrdup(toys.optargs[j]);
206 j++; 206 j++;
207 } 207 }
208 args[i] = finfo->device; 208 args[i] = finfo->device;