summaryrefslogtreecommitdiff
path: root/x11/hanterm/patches/patch-util.c
blob: c928a91875283084f25825ff2a6a7ed037c14d0a (plain)
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
27
28
29
30
31
32
33
34
35
36
37
$NetBSD: patch-util.c,v 1.1 2013/11/24 05:53:52 dholland Exp $

- use standard headers
- don't cast result of malloc

--- util.c~	1999-03-05 06:59:09.000000000 +0000
+++ util.c
@@ -33,6 +33,7 @@
 #include "menu.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 extern void HideCursor();
 extern void ScrollBarReverseVideo();
@@ -1126,8 +1127,8 @@ int xstrcasecmp(s1, s2)
   int i, r;
   char *t1, *t2;
 
-  t1 = (char *)malloc(strlen(s1)+1);
-  t2 = (char *)malloc(strlen(s2)+1);
+  t1 = malloc(strlen(s1)+1);
+  t2 = malloc(strlen(s2)+1);
 
   for(i=0; s1[i]; i++) t1[i] = x2lower(s1[i]);
   t1[i] = 0;
@@ -1147,8 +1148,8 @@ int xstrncasecmp(s1, s2, n)
   int i, r;
   char *t1, *t2;
 
-  t1 = (char *)malloc(strlen(s1)+1);
-  t2 = (char *)malloc(strlen(s2)+1);
+  t1 = malloc(strlen(s1)+1);
+  t2 = malloc(strlen(s2)+1);
 
   for(i=0; s1[i]; i++) t1[i] = x2lower(s1[i]);
   t1[i] = 0;