Bug#647501: Infinite loop on architectures where char is unsigned by default
Package: sludge-engine
Version: 2.1.2-3
Severity: important
Tags: patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The attached patch fixes an infinite loop on architectures (such as powerpc)
where the char type is unsigned by default (so the test for -1 can never
succeed).
- -- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (102, 'experimental')
Architecture: powerpc (ppc)
Kernel: Linux 3.1.0+
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages sludge-engine depends on:
ii libalure1 1.2-2
ii libc6 2.13-21
ii libgcc1 1:4.6.2-3
ii libgl1-mesa-glx [libgl1] 7.11-6
ii libglee0d1 5.4.0-1
ii libglu1-mesa [libglu1] 7.11-6
ii libogg0 1.2.2~dfsg-1
ii libopenal1 1:1.13-4
ii libpng12-0 <none>
ii libsdl1.2debian 1.2.14-6.4
ii libstdc++6 4.6.2-3
ii libvorbis0a 1.3.2-1
ii libvpx0 0.9.7.p1-2
ii xdg-utils 1.1.0~rc1-2
sludge-engine recommends no packages.
Versions of packages sludge-engine suggests:
pn sludge-devkit <none>
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iD8DBQFOsnDSWoGvjmrbsgARAinGAJsHOkP2ayZyQ8ATs1VnM7pezRSwKwCgoDpt
3Y8oCBHb16P0K/MK895GcT8=
=rNnH
-----END PGP SIGNATURE-----
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/CompilerMain.cpp sludge-2.1.2/GTK_Dev_Kit/CompilerMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/CompilerMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/CompilerMain.cpp 2011-11-03 10:32:45.000000000 +0100
@@ -38,7 +38,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long (argc, argv, "h", long_options, &option_index);
+ int c = getopt_long (argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/FloorMakerMain.cpp sludge-2.1.2/GTK_Dev_Kit/FloorMakerMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/FloorMakerMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/FloorMakerMain.cpp 2011-11-03 10:32:55.000000000 +0100
@@ -242,7 +242,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long (argc, argv, "h", long_options, &option_index);
+ int c = getopt_long (argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/ProjectManagerMain.cpp sludge-2.1.2/GTK_Dev_Kit/ProjectManagerMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/ProjectManagerMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/ProjectManagerMain.cpp 2011-11-03 10:33:04.000000000 +0100
@@ -226,7 +226,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long(argc, argv, "h", long_options, &option_index);
+ int c = getopt_long(argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/SpriteBankEditorMain.cpp sludge-2.1.2/GTK_Dev_Kit/SpriteBankEditorMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/SpriteBankEditorMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/SpriteBankEditorMain.cpp 2011-11-03 10:33:12.000000000 +0100
@@ -249,7 +249,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long(argc, argv, "h", long_options, &option_index);
+ int c = getopt_long(argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/TranslationEditorMain.cpp sludge-2.1.2/GTK_Dev_Kit/TranslationEditorMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/TranslationEditorMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/TranslationEditorMain.cpp 2011-11-03 10:33:21.000000000 +0100
@@ -156,7 +156,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long(argc, argv, "h", long_options, &option_index);
+ int c = getopt_long(argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/GTK_Dev_Kit/ZBufferMakerMain.cpp sludge-2.1.2/GTK_Dev_Kit/ZBufferMakerMain.cpp
--- sludge-2.1.2.orig/GTK_Dev_Kit/ZBufferMakerMain.cpp 2011-09-26 11:55:33.000000000 +0200
+++ sludge-2.1.2/GTK_Dev_Kit/ZBufferMakerMain.cpp 2011-11-03 10:32:03.000000000 +0100
@@ -179,7 +179,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long(argc, argv, "h", long_options, &option_index);
+ int c = getopt_long(argc, argv, "h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'h':
diff -up -ru sludge-2.1.2.orig/source/Engine/linuxstuff.cpp sludge-2.1.2/source/Engine/linuxstuff.cpp
--- sludge-2.1.2.orig/source/Engine/linuxstuff.cpp 2011-09-26 11:55:36.000000000 +0200
+++ sludge-2.1.2/source/Engine/linuxstuff.cpp 2011-11-03 10:32:15.000000000 +0100
@@ -56,7 +56,7 @@ bool parseCmdlineParameters(int argc, ch
{0,0,0,0} /* This is a filler for -1 */
};
int option_index = 0;
- char c = getopt_long (argc, argv, "fwl:a:d:h", long_options, &option_index);
+ int c = getopt_long (argc, argv, "fwl:a:d:h", long_options, &option_index);
if (c == -1) break;
switch (c) {
case 'f':
Reply to: