int cnt, pathc;
const char *s;
char *dest;
- for (cnt=1, s=src; *s; s++) {
+ for (cnt=1, s=src; s && *s; s++) {
if (*s == '\\') s++;
cnt++;
}
if (pglob->gl_pathv == NULL) return GLOB_NOSPACE;
pglob->gl_pathv[pathc-1]=dest;
pglob->gl_pathv[pathc]=NULL;
- for (s=src; *s; s++, dest++) {
+ for (s=src; s && *s; s++, dest++) {
if (*s == '\\') s++;
*dest = *s;
}
{ "done", RES_DONE, FLAG_END }
};
struct reserved_combo *r;
+ if (dest->data == NULL)
+ return 0;
for (r=reserved_list;
#define NRES sizeof(reserved_list)/sizeof(struct reserved_combo)
r<reserved_list+NRES; r++) {
int cnt, pathc;
const char *s;
char *dest;
- for (cnt=1, s=src; *s; s++) {
+ for (cnt=1, s=src; s && *s; s++) {
if (*s == '\\') s++;
cnt++;
}
if (pglob->gl_pathv == NULL) return GLOB_NOSPACE;
pglob->gl_pathv[pathc-1]=dest;
pglob->gl_pathv[pathc]=NULL;
- for (s=src; *s; s++, dest++) {
+ for (s=src; s && *s; s++, dest++) {
if (*s == '\\') s++;
*dest = *s;
}
{ "done", RES_DONE, FLAG_END }
};
struct reserved_combo *r;
+ if (dest->data == NULL)
+ return 0;
for (r=reserved_list;
#define NRES sizeof(reserved_list)/sizeof(struct reserved_combo)
r<reserved_list+NRES; r++) {