A new user interface for you! Read more...

File rpmbuild-duplicate-bufsize.diff of Package rpm

--- build/expression.c
+++ build/expression.c
@@ -137,7 +137,7 @@
 #define TOK_LOGICAL_OR  19
 /*@}*/
 
-#define	EXPRBUFSIZ	BUFSIZ
+#define	EXPRBUFSIZ	3*BUFSIZ
 
 #if defined(DEBUG_PARSER)
 typedef struct exprTokTableEntry {
--- build/parseSpec.c
+++ build/parseSpec.c
@@ -250,7 +250,7 @@
 	/*@-type@*/ /* FIX: cast? */
 	FILE * f = fdGetFp(ofi->fd);
 	/*@=type@*/
-	if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) {
+	if (f == NULL || !fgets(ofi->readBuf, 3*BUFSIZ, f)) {
 	    /* EOF */
 	    if (spec->readStack->next) {
 		rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n"));
--- build/rpmspec.h
+++ build/rpmspec.h
@@ -53,7 +53,7 @@
 /*@only@*/ const char * fileName;
     FD_t fd;
     int lineNum;
-    char readBuf[BUFSIZ];
+    char readBuf[3*BUFSIZ];
 /*@dependent@*/
     char * readPtr;
 /*@owned@*/
@@ -106,7 +106,7 @@
 
 /*@owned@*/
     struct OpenFileInfo * fileStack;
-    char lbuf[10*BUFSIZ];
+    char lbuf[100*BUFSIZ];
 /*@dependent@*/
     char *lbufPtr;
     char nextpeekc;
--- rpmio/macro.c
+++ rpmio/macro.c
@@ -599,7 +599,7 @@
 	/*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
 	/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
 {
-    char pcmd[BUFSIZ];
+    char pcmd[3*BUFSIZ];
     FILE *shf;
     int rc;
     int c;
@@ -647,7 +647,7 @@
 	/*@modifies mb, rpmGlobalMacroContext @*/
 {
     const char *s = se;
-    char buf[BUFSIZ], *n = buf, *ne = n;
+    char buf[3*BUFSIZ], *n = buf, *ne = n;
     char *o = NULL, *oe;
     char *b, *be;
     int c;
@@ -773,7 +773,7 @@
 	/*@modifies mc, rpmGlobalMacroContext @*/
 {
     const char *s = se;
-    char buf[BUFSIZ], *n = buf, *ne = n;
+    char buf[3*BUFSIZ], *n = buf, *ne = n;
     int c;
 
     COPYNAME(ne, s, c);
@@ -934,7 +934,7 @@
 	/*@globals rpmGlobalMacroContext @*/
 	/*@modifies mb, rpmGlobalMacroContext @*/
 {
-    char buf[BUFSIZ], *b, *be;
+    char buf[3*BUFSIZ], *b, *be;
     char aname[16];
     const char *opts, *o;
     int argc = 0;
@@ -1087,7 +1087,7 @@
 	/*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
 	/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
 {
-    char buf[BUFSIZ];
+    char buf[3*BUFSIZ];
 
     if (msglen >= sizeof(buf)) {
 	rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
@@ -1117,7 +1117,7 @@
 	/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
 	/*@modifies mb, rpmGlobalMacroContext, fileSystem, internalState @*/
 {
-    char buf[BUFSIZ], *b = NULL, *be;
+    char buf[3*BUFSIZ], *b = NULL, *be;
     int c;
 
     buf[0] = '\0';
@@ -1960,7 +1960,7 @@
 rpmLoadMacroFile(MacroContext mc, const char * fn)
 {
     FD_t fd = Fopen(fn, "r.fpio");
-    char buf[BUFSIZ];
+    char buf[3*BUFSIZ];
     int rc = -1;
 
     if (fd == NULL || Ferror(fd)) {
@@ -2148,7 +2148,7 @@
 char * 
 rpmExpand(const char *arg, ...)
 {
-    char buf[BUFSIZ], *p, *pe;
+    char buf[3*BUFSIZ], *p, *pe;
     const char *s;
     va_list ap;
 
@@ -2286,7 +2286,7 @@
 const char *
 rpmGetPath(const char *path, ...)
 {
-    char buf[BUFSIZ];
+    char buf[3*BUFSIZ];
     const char * s;
     char * t, * te;
     va_list ap;
@@ -2435,7 +2435,7 @@
 int
 main(int argc, char *argv[])
 {
-    char buf[BUFSIZ];
+    char buf[3*BUFSIZ];
     FILE *fp;
     int x;