Use unsuspicous var name to not confuse syntax highlighter.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Klaas Freitag 2013-07-08 09:50:50 +02:00 committed by Andreas Schneider
parent 5f9913570a
commit bf6a0ea68e

View file

@ -38,7 +38,7 @@
* dirname - parse directory component. * dirname - parse directory component.
*/ */
char *c_dirname (const char *path) { char *c_dirname (const char *path) {
char *new = NULL; char *newbuf = NULL;
unsigned int len; unsigned int len;
if (path == NULL || *path == '\0') { if (path == NULL || *path == '\0') {
@ -67,19 +67,19 @@ char *c_dirname (const char *path) {
/* Remove slashes again */ /* Remove slashes again */
while(len > 0 && path[len - 1] == '/') --len; while(len > 0 && path[len - 1] == '/') --len;
new = c_malloc(len + 1); newbuf = c_malloc(len + 1);
if (new == NULL) { if (newbuf == NULL) {
return NULL; return NULL;
} }
strncpy(new, path, len); strncpy(newbuf, path, len);
new[len] = '\0'; newbuf[len] = '\0';
return new; return newbuf;
} }
char *c_basename (const char *path) { char *c_basename (const char *path) {
char *new = NULL; char *newbuf = NULL;
const char *s; const char *s;
unsigned int len; unsigned int len;
@ -107,15 +107,15 @@ char *c_basename (const char *path) {
return c_strdup(path); return c_strdup(path);
} }
new = c_malloc(len + 1); newbuf = c_malloc(len + 1);
if (new == NULL) { if (newbuf == NULL) {
return NULL; return NULL;
} }
strncpy(new, s, len); strncpy(newbuf, s, len);
new[len] = '\0'; newbuf[len] = '\0';
return new; return newbuf;
} }
int c_tmpname(char *template) { int c_tmpname(char *template) {