[packages/transfig] Format string usage fixes

jajcus jajcus at pld-linux.org
Sat Oct 5 19:10:55 CEST 2013


commit 5ccd30168d6159060256b3c9a8f7a3146dd393c3
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Sat Oct 5 19:10:31 2013 +0200

    Format string usage fixes

 transfig-format_string.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++
 transfig.spec                |  2 ++
 2 files changed, 56 insertions(+)
---
diff --git a/transfig.spec b/transfig.spec
index 23b8379..0ced59e 100644
--- a/transfig.spec
+++ b/transfig.spec
@@ -20,6 +20,7 @@ Source0:	http://downloads.sourceforge.net/mcj/%{name}.%{version}.tar.gz
 Patch0:		%{name}-config.patch
 Patch1:		%{name}-broken.patch
 Patch2:		%{name}-3.2.5c-maxfontsize.patch
+Patch3:		%{name}-format_string.patch
 URL:		http://xfig.org/
 BuildRequires:	libjpeg-devel
 BuildRequires:	libpng-devel
@@ -88,6 +89,7 @@ TeX документів, які є портабельними (тобто, мо
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 xmkmf -a
diff --git a/transfig-format_string.patch b/transfig-format_string.patch
new file mode 100644
index 0000000..66edac5
--- /dev/null
+++ b/transfig-format_string.patch
@@ -0,0 +1,54 @@
+diff -dur transfig.3.2.5e.orig/fig2dev/dev/gencgm.c transfig.3.2.5e/fig2dev/dev/gencgm.c
+--- transfig.3.2.5e.orig/fig2dev/dev/gencgm.c	2003-09-20 01:03:48.000000000 +0200
++++ transfig.3.2.5e/fig2dev/dev/gencgm.c	2013-10-05 19:08:48.115907807 +0200
+@@ -139,7 +139,7 @@
+   
+   if (from) {
+ 	figname = malloc(strlen(from)+1);
+-	sprintf(figname, from);
++	sprintf(figname, "%s", from);
+ 	p = strrchr(figname, '/');
+ 	if (p) 
+ 	    figname = p+1;		/* remove path from name for comment in file */
+diff -dur transfig.3.2.5e.orig/fig2dev/dev/genmp.c transfig.3.2.5e/fig2dev/dev/genmp.c
+--- transfig.3.2.5e.orig/fig2dev/dev/genmp.c	2007-04-02 23:45:34.000000000 +0200
++++ transfig.3.2.5e/fig2dev/dev/genmp.c	2013-10-05 19:09:24.866177569 +0200
+@@ -1150,7 +1150,7 @@
+ 	    }
+ 	} else {
+ 	    /* special text in latex mode: just write the text. */
+-	    fprintf(tfp, t->cstring);
++	    fprintf(tfp, "%s", t->cstring);
+ 	}
+ 	fprintf(tfp," etex;\n");
+ 
+@@ -1164,7 +1164,7 @@
+ 
+ 	fprintf(tfp,"  picture q;\n");
+ 	fprintf(tfp,"  q=thelabel.urt(\"");
+-        fprintf(tfp, t->cstring);
++        fprintf(tfp, "%s", t->cstring);
+ 	fprintf(tfp, "\" infont ");
+ 	if (t->font<0) {
+ 	    fprintf(tfp, "defaultfont");
+diff -dur transfig.3.2.5e.orig/fig2dev/trans_spline.c transfig.3.2.5e/fig2dev/trans_spline.c
+--- transfig.3.2.5e.orig/fig2dev/trans_spline.c	2004-03-29 20:54:40.000000000 +0200
++++ transfig.3.2.5e/fig2dev/trans_spline.c	2013-10-05 19:08:48.115907807 +0200
+@@ -648,7 +648,7 @@
+     F_control	   *cp;
+ 
+     if ((cp = (F_control *) malloc(CONTROL_SIZE)) == NULL)
+-	fprintf(stderr,Err_mem);
++	fprintf(stderr,"%s",Err_mem);
+     return cp;
+ }
+ 
+@@ -659,7 +659,7 @@
+     F_line	   *l;
+ 
+     if ((l = (F_line *) malloc(LINOBJ_SIZE)) == NULL)
+-	fprintf(stderr,Err_mem);
++	fprintf(stderr,"%s",Err_mem);
+     l->pic = NULL;
+     l->next = NULL;
+     l->for_arrow = NULL;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/transfig.git/commitdiff/5ccd30168d6159060256b3c9a8f7a3146dd393c3



More information about the pld-cvs-commit mailing list