File: 20_auth_c.diff

package info (click to toggle)
nd 0.8.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 624 kB
  • sloc: ansic: 7,810; sh: 717; makefile: 7
file content (80 lines) | stat: -rw-r--r-- 2,349 bytes parent folder | download | duplicates (5)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Description: Avoid compiler warnings for auth.c
 Enable silent transition between string types 'xmlChar *'
 and 'char *'. Libxml2 is not consistent.
 .
 Reformulate an integer "177" as the intended octal value "0177".
Forwarded: yes
Author: Mats Erik Andersson <mats.andersson@gisladisker.se>
Last-Update: 2009-12-18
--- nd-0.8.2.orig/auth.c
+++ nd-0.8.2/auth.c
@@ -37,7 +37,7 @@
     {NULL, NULL}
   };
 
-/* util for convinience */
+/* utility for convenience */
 void
 xmlBufferAddChar (buf, ch)
      xmlBufferPtr buf;
@@ -46,7 +46,7 @@
   char str[2];
   str [0] = ch;
   str [1] = '\0';
-  xmlBufferAdd(buf, str, 1);
+  xmlBufferAdd(buf, (xmlChar *) str, 1);
 }
 
 char *
@@ -92,7 +92,7 @@
 		qq++;
 		goto end_token;
 	      default:
-		if (*qq <= 037 || *qq == 177)
+		if (*qq <= 037 || *qq == 0177)
 		  {
 		    qq++;
 		    goto end_token;
@@ -110,7 +110,7 @@
 	if (*qq == ',')
 	  qq++;
       }
-    *q = qq;
+    *q = (char *) qq;
     ret = (char *) xmlBufferContent(val);
     xmlFree (val);
     return ret;
@@ -270,9 +270,9 @@
      ndAuthParamPtr param;
 {
   xmlBufferPtr buf = xmlBufferCreate ();
-  xmlBufferAdd (buf, ndAuthParamValue (param, "user"), -1);
-  xmlBufferAdd (buf, ":", -1);
-  xmlBufferAdd (buf, ndAuthParamValue (param, "password"), -1);
+  xmlBufferAdd (buf, (xmlChar *) ndAuthParamValue (param, "user"), -1);
+  xmlBufferAdd (buf, (xmlChar *) ":", -1);
+  xmlBufferAdd (buf, (xmlChar *) ndAuthParamValue (param, "password"), -1);
   return ndAuthEncodeB ((char *) xmlBufferContent (buf));
 }
 
@@ -315,14 +315,15 @@
       xmlBufferPtr ret = xmlBufferCreate ();
 
       xmlBufferAdd (ret,
-		    is_proxy? "Proxy-Authorization:" : "Authorization: ",
-		    -1);
-      xmlBufferAdd (ret, ndAuthParamValue (param, "name"), -1);
-      xmlBufferAdd (ret, " ", -1);
+                    is_proxy ? (xmlChar *) "Proxy-Authorization:"
+                             : (xmlChar *) "Authorization: ",
+                    -1);
+      xmlBufferAdd (ret, (xmlChar *) ndAuthParamValue (param, "name"), -1);
+      xmlBufferAdd (ret, (xmlChar *) " ", -1);
       tmp = hauth->auth_fn (param);
       ndAuthParamFree (param);
       xmlBufferAdd (ret, xmlBufferContent (tmp), -1);
-      xmlBufferAdd (ret, "\r\n", -1);
+      xmlBufferAdd (ret, (xmlChar *) "\r\n", -1);
       *buf_return = ret;
       return 0;
     }