comparison toys/posix/cp.c @ 1714:0c8ef714cf03 draft

Patches from Elliott Hughes to fix various printf() format strings. (Don't specify the space flag when it's the default behavior. The ifconfig stuff was actual bugs.)
author Rob Landley <rob@landley.net>
date Sun, 01 Mar 2015 16:08:51 -0600
parents dee053b7c775
children 5a00bc5e1c0f
comparison
equal deleted inserted replaced
1713:58d9f1b61f0a 1714:0c8ef714cf03
206 s = dirtree_path(try, 0); 206 s = dirtree_path(try, 0);
207 for (or = try; or->parent; or = or->parent) dotdots++; 207 for (or = try; or->parent; or = or->parent) dotdots++;
208 208
209 if (*or->name == '/') dotdots = 0; 209 if (*or->name == '/') dotdots = 0;
210 if (dotdots) { 210 if (dotdots) {
211 char *s2 = xmprintf("% *c%s", 3*dotdots, ' ', s); 211 char *s2 = xmprintf("%*c%s", 3*dotdots, ' ', s);
212 free(s); 212 free(s);
213 s = s2; 213 s = s2;
214 while(dotdots--) { 214 while(dotdots--) {
215 memcpy(s2, "../", 3); 215 memcpy(s2, "../", 3);
216 s2 += 3; 216 s2 += 3;