summaryrefslogtreecommitdiff
path: root/comms/scmxx/patches/patch-aa
blob: 920161ba5c080aa812c31251895f91b40b9c485f (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
38
$NetBSD: patch-aa,v 1.9 2005/07/14 19:17:00 wiz Exp $

--- src/pinfile.c.orig	2005-06-08 19:49:17.000000000 +0200
+++ src/pinfile.c
@@ -220,7 +220,14 @@ char* pinfile_get_subdata (const char* s
       mem_realloc(temp,0);
       if (pin != NULL) {
 	//find_pinpuk() already checked it
-	puk = strndup(puk,strchr(puk,';')-puk);
+	char *foo;
+
+	foo = strchr(puk,';');
+	if (foo != NULL)
+		*foo = '\0';
+	puk = strdup(puk);
+	if (foo != NULL)
+		*foo = ';';
       }
     }
   } else {
@@ -232,9 +239,16 @@ char* pinfile_get_subdata (const char* s
     print_verbose(0,"%s\n",_("not found"));
     return strdup("");
   } else {
+    char *foo;
+
     print_verbose(0,"%s\n",_("found"));
     //find_pinpuk() already checked it
-    pin = strndup(pin,strchr(pin,';')-pin);
+    foo = strchr(pin,';');
+    if (foo != NULL)
+	*foo = '\0';
+    pin = strdup(pin);
+    if (foo != NULL)
+	*foo = ';';
     mem_realloc(data,0);
     if (puk == NULL) {
       return pin;