summaryrefslogtreecommitdiff
path: root/textproc/sablotron/patches/patch-aa
blob: d3f49cc2542d8c086e98fbce8aba93cc61c80495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$NetBSD: patch-aa,v 1.4 2007/01/05 13:48:14 dmcmahill Exp $

needed to build with sun studio compilers.
Patch submitted to sab-bugs at gingerall dot com
on 2007-01-05

--- src/command/sabcmd.cpp.orig	2004-12-30 04:30:44.000000000 -0500
+++ src/command/sabcmd.cpp
@@ -211,8 +211,10 @@ void saberrn(const char *msg, int num)
 
 int chrpos(const char *text, char c)
 {
-    char *p = strchr(text, c);
-    return p ? (int)(p - text) : -1;
+    const char *p;
+
+    p = strchr(text, (int) c);
+    return (p != NULL) ? (int)(p - text) : -1;
 }
 
 void freefirst(char **array)