From: Christos Zoulas Date: Tue, 6 May 2008 11:07:41 +0000 (+0000) Subject: bob's cleanup patches. X-Git-Tag: FILE4_25~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7c4f4fcf8d054d03fc5022d249c38c30f230202;p=file bob's cleanup patches. --- diff --git a/ChangeLog b/ChangeLog index 1facec14..c20981ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,25 @@ * >= <= is not supported, so fix the magic and warn about it. reported by: Thien-Thi Nguyen +2008-05-06 00:13 Robert Byrnes + + * src/Makefile.am: + Ensure that getopt_long and [v]asprintf are included in libmagic, + as needed. + + Remove unnecessary EXTRA_DIST. + + * src/Makefile.in: + Rerun automake. + + * src/vasprintf.c (dispatch): + Fix variable precision bug: be sure to step past '*'. + + * src/vasprintf.c (core): + Remove unreachable code. + + * src/apprentice.c (set_test_type): + Add cast to avoid compiler warning. 2008-03-27 16:16 Robert Byrnes diff --git a/src/Makefile.am b/src/Makefile.am index 2860e6ea..99934dab 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@ MAGIC = $(pkgdatadir)/magic lib_LTLIBRARIES = libmagic.la include_HEADERS = magic.h -EXTRA_DIST = getopt_long.c bin_PROGRAMS = file @@ -12,6 +11,7 @@ libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \ funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c \ file_opts.h elfclass.h libmagic_la_LDFLAGS = -no-undefined -version-info 1:0:0 +libmagic_la_LIBADD = $(LTLIBOBJS) file_SOURCES = file.c file_LDADD = libmagic.la diff --git a/src/vasprintf.c b/src/vasprintf.c index acb6eda0..6e1846b7 100644 --- a/src/vasprintf.c +++ b/src/vasprintf.c @@ -367,6 +367,7 @@ static int dispatch(xprintf_struct *s) if (*SRCTXT == '.') { SRCTXT++; if (*SRCTXT == '*') { /* .prec given by next argument */ + SRCTXT++; prec = va_arg(s->vargs, int); if ((size_t)prec >= 0x3fffU) /* 'size_t' to check against negative values too */ prec = 0x3fff; @@ -593,9 +594,6 @@ static int core(xprintf_struct *s) return EOF; /* should rarely happen because we shrink the buffer */ return s->pseudo_len; - free(s->buffer_base); - return s->pseudo_len; - free_EOF: if (s->buffer_base != NULL) free(s->buffer_base);