public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/xfig] epel10: - Fix xfig crashing when zooming in a lot (bz 420411)
@ 2026-05-30 14:25 Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2026-05-30 14:25 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/xfig
Branch : epel10
Commit : 5c5567a161b252e0d8e6c830d1b0761041a2fedc
Author : Hans de Goede <jwrdegoede@fedoraproject.org>
Date : 2007-12-12T19:34:13+00:00
Stats : +66/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/xfig/c/5c5567a161b252e0d8e6c830d1b0761041a2fedc?branch=epel10
Log:
- Fix xfig crashing when zooming in a lot (bz 420411)
---
diff --git a/xfig-3.2.5-zoom-crash.patch b/xfig-3.2.5-zoom-crash.patch
new file mode 100644
index 0000000..49bfbcd
--- /dev/null
+++ b/xfig-3.2.5-zoom-crash.patch
@@ -0,0 +1,60 @@
+diff -up xfig.3.2.5/w_rulers.c~ xfig.3.2.5/w_rulers.c
+--- xfig.3.2.5/w_rulers.c~ 2007-12-12 20:28:30.000000000 +0100
++++ xfig.3.2.5/w_rulers.c 2007-12-12 20:28:30.000000000 +0100
+@@ -1166,7 +1166,7 @@ void reset_topruler(void)
+ register int i,k;
+ register tick_info* tk;
+ register Pixmap p = topruler_pm;
+- char number[6];
++ char number[16];
+ int X0,len;
+ int tickmod, tickskip;
+
+@@ -1183,7 +1183,7 @@ void reset_topruler(void)
+ tickmod = 1;
+
+ /* see how big a label is to adjust spacing, if necessary */
+- sprintf(number, "%d%s", (X0+(int)((TOPRULER_WD/zoomscale)))/tickmod, cur_fig_units);
++ snprintf(number, sizeof(number), "%d%s", (X0+(int)((TOPRULER_WD/zoomscale)))/tickmod, cur_fig_units);
+ len = XTextWidth(roman_font, number, strlen(number));
+ while (skipx < (len + 5)/zoomscale) {
+ skip *= 2;
+@@ -1197,11 +1197,11 @@ void reset_topruler(void)
+ /* string */
+ if (i % skipx == 0) {
+ if ((i/10) % tickmod == 0)
+- sprintf(number, "%d%s", i/tickmod, cur_fig_units);
++ snprintf(number, sizeof(number), "%d%s", i/tickmod, cur_fig_units);
+ else if (i % tickmod == 0)
+- sprintf(number, "%d", i/tickmod);
++ snprintf(number, sizeof(number), "%d", i/tickmod);
+ else
+- sprintf(number, precstr, (float)(1.0 * i / tickmod));
++ snprintf(number, sizeof(number), precstr, (float)(1.0 * i / tickmod));
+ /* get length of string to position it */
+ len = XTextWidth(roman_font, number, strlen(number));
+ /* we center on the number only, letting the minus sign hang out */
+@@ -1425,7 +1425,7 @@ void reset_sideruler(void)
+ register int i,k;
+ register tick_info* tk;
+ register Pixmap p = sideruler_pm;
+- char number[6],len;
++ char number[16],len;
+ int Y0;
+ int tickmod, tickskip;
+
+@@ -1456,11 +1456,11 @@ void reset_sideruler(void)
+ /* string */
+ if (i % skipx == 0) {
+ if ((i/10) % tickmod == 0)
+- sprintf(number, "%d%s", i/tickmod, cur_fig_units);
++ snprintf(number, sizeof(number), "%d%s", i/tickmod, cur_fig_units);
+ else if (i % tickmod == 0)
+- sprintf(number, "%d", i/tickmod);
++ snprintf(number, sizeof(number), "%d", i/tickmod);
+ else
+- sprintf(number, precstr, (float)(1.0 * i / tickmod));
++ snprintf(number, sizeof(number), precstr, (float)(1.0 * i / tickmod));
+ /* get length of string to position it */
+ len = XTextWidth(roman_font, number, strlen(number));
+ /* vertically centered on inch/cm mark */
diff --git a/xfig.spec b/xfig.spec
index cf3a60a..b83f197 100644
--- a/xfig.spec
+++ b/xfig.spec
@@ -3,7 +3,7 @@
Summary: An X Window System tool for drawing basic vector graphics
Name: xfig
Version: 3.2.5
-Release: 6%{?dist}
+Release: 7%{?dist}
License: MIT
Group: Applications/Multimedia
URL: http://www.xfig.org/
@@ -21,6 +21,7 @@ Patch10: xfig-3.2.5-enable-Xaw3d.patch
Patch11: xfig-3.2.5-color-resources.patch
Patch12: xfig-3.2.5-quiet.patch
Patch13: xfig-3.2.5-urwfonts.patch
+Patch14: xfig-3.2.5-zoom-crash.patch
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
@@ -93,6 +94,7 @@ Files common to both the plain Xaw and the Xaw3d version of xfig.
%patch11 -p1 -b .color-resources
%patch12 -p1 -b .quiet
%patch13 -p1 -b .urw
+%patch14 -p1 -b .zoom-crash
ln -nfs Doc/xfig.man xfig.man
find -type f -print0 | xargs -0 chmod -x
rm `find Doc -name '*.orig'` Doc/html/*.save Doc/html/images/sav1a0.tmp
@@ -180,6 +182,9 @@ fi
%changelog
+* Wed Dec 12 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 3.2.5-7
+- Fix xfig crashing when zooming in a lot (bz 420411)
+
* Sat Nov 17 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 3.2.5-6
- Put the Xaw3d version in the main xfig package, put the plain Xaw version
in a -plain subpackage
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-30 14:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-30 14:25 [rpms/xfig] epel10: - Fix xfig crashing when zooming in a lot (bz 420411) Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox