+2007-02-13 Guillem Jover <guillem@debian.org>
+
+ * dpkg-deb/dpkg-deb.h (MAXFILENAME): New macro.
+ * dpkg-deb/build.c (getfi): Use MAXFILENAME instead of the hardcoded
+ value '2048'.
+
2007-02-13 Guillem Jover <guillem@debian.org>
* lib/compression.c (decompress_cat): Use BZ_IO_ERROR instead of
size_t rl = strlen(root);
if (fn == NULL) {
- fnlen=rl+2048;
+ fnlen = rl + MAXFILENAME;
fn=(char*)malloc(fnlen);
- } else if (fnlen < (rl+2048)) {
- fnlen=rl+2048;
+ } else if (fnlen < (rl + MAXFILENAME)) {
+ fnlen = rl + MAXFILENAME;
fn=(char*)realloc(fn,fnlen);
}
i=sprintf(fn,"%s/",root);
while (1) {
int res;
if (i>=fnlen) {
- fnlen+=2048;
+ fnlen += MAXFILENAME;
fn=(char*)realloc(fn,fnlen);
}
if ((res=read(fd, (fn+i), sizeof(*fn)))<0) {
break;
i++;
- assert(i<2048);
+ assert(i < MAXFILENAME);
}
fi=(struct _finfo*)malloc(sizeof(struct _finfo));