+2008-06-04 Guillem Jover <guillem@debian.org>
+
+ * dpkg-deb/build.c (getfi): Use m_realloc instead of realloc.
+ * dpkg-deb/info.c (info_spew): Likewise.
+ * lib/fields.c (f_dependency): Likewise.
+ * lib/parse.c (parsedb): Likewise.
+ * lib/varbuf.c (varbufextend): Likewise.
+ * src/main.c (commandfd): Likewise.
+
2008-06-04 Guillem Jover <guillem@debian.org>
* lib/dpkg-db.h (varbufinit): Add a size argument, fix all callers.
are path names, but not on patterns. Closes: #129577
* Fix the support for passing more than one --status-fd option to dpkg.
Until now only the last one was being used.
+ * Replace realloc plus error checking usage with m_realloc.
[ Raphael Hertzog ]
* Enhance dpkg-shlibdeps's error message when a library can't be found to
fn = m_malloc(fnlen);
} else if (fnlen < (rl + MAXFILENAME)) {
fnlen = rl + MAXFILENAME;
- fn=(char*)realloc(fn,fnlen);
+ fn = m_realloc(fn, fnlen);
}
i=sprintf(fn,"%s/",root);
int res;
if (i>=fnlen) {
fnlen += MAXFILENAME;
- fn=(char*)realloc(fn,fnlen);
+ fn = m_realloc(fn, fnlen);
}
if ((res=read(fd, (fn+i), sizeof(*fn)))<0) {
if ((errno==EINTR) || (errno==EAGAIN))
while ((component = *argv++) != NULL) {
pathlen = strlen(directory) + strlen(component) + 2;
- controlfile = (void *) realloc((void *) controlfile, pathlen);
- if (!controlfile)
- ohshite(_("realloc failed (%zu bytes)"), pathlen);
+ controlfile = m_realloc(controlfile, pathlen);
memset(controlfile, 0, sizeof(controlfile));
strcat(controlfile, directory);
depnamelength= p - depnamestart ;
if (depnamelength >= depnameused) {
depnameused= depnamelength;
- depname= realloc(depname,depnamelength+1);
+ depname = m_realloc(depname, depnamelength + 1);
}
strncpy(depname, depnamestart, depnamelength);
*(depname + depnamelength)= 0;
"version unterminated"),fip->name,depname);
if (versionlength >= versionused) {
versionused= versionlength;
- version= realloc(version,versionlength+1);
+ version = m_realloc(version, versionlength + 1);
}
strncpy(version, versionstart, versionlength);
*(version + versionlength)= 0;
fip->name && strncasecmp(fieldstart,fip->name, fieldlen);
fip++, ip++);
if (fip->name) {
- value= realloc(value,valuelen+1);
+ value = m_realloc(value, valuelen + 1);
memcpy(value,valuestart,valuelen);
*(value+valuelen)= 0;
if (*ip++)
char *newbuf;
newsize= v->size + 80 + v->used;
- newbuf= realloc(v->buf,newsize);
- if (!newbuf) ohshite(_("failed to realloc for variable buffer"));
+ newbuf = m_realloc(v->buf, newsize);
v->size= newsize;
v->buf= newbuf;
}
if (!argc) continue;
varbufaddc(&linevb,0);
printf("line=`%*s'\n",(int)linevb.used,linevb.buf);
- oldargs= newargs= realloc(oldargs,sizeof(const char *) * (argc + 1));
+ oldargs = newargs = m_realloc(oldargs, sizeof(const char *) * (argc + 1));
argc= 1;
ptr= linevb.buf;
endptr= ptr + linevb.used;