accumulated post-1.4.0 fixes

This commit is contained in:
Denis Vlasenko
2007-01-24 22:02:01 +00:00
parent 84d2d493b4
commit 218f2f4882
8 changed files with 45 additions and 37 deletions

View File

@ -81,13 +81,14 @@ char * xstrndup(const char *s, int n)
t = (char*) s;
while (m) {
if (!*t) break;
m--; t++;
m--;
t++;
}
n = n - m;
n -= m;
t = xmalloc(n + 1);
t[n] = '\0';
return memcpy(t,s,n);
return memcpy(t, s, n);
}
// Die if we can't open a file and return a FILE * to it.