File: fix-infinite-loop-on-powerpc.patch

package info (click to toggle)
tcpick 0.2.1-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,184 kB
  • sloc: ansic: 2,557; sh: 931; makefile: 16
file content (26 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix infinite loop on powerpc
 On the ppc C compiler, char is an unsigned data type. This means that
 no variable of type char can ever compare equal to the int value -1. gcc
 tries to warn you about this when you compile tcpick, by saying:
 .
 args.c:195: warning: comparison is always true due to limited range of
 data type
 .
 tcpick therefore never makes it past the getopt loop. The following
 patch fixes the problem.
Author: Alan Curry <pacman@world.std.com>
Origin: other, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327327#5
Bug-Debian: http://bugs.debian.org/327327
Last-Update: 2005-09-09

--- a/src/args.c
+++ b/src/args.c
@@ -149,7 +149,7 @@
 void
 parse_args(int argc, char ** argv)
 {
-	char opt;
+	int opt;
 
 #ifdef HAVE_GETOPT_LONG
 	static struct option long_options[]=