Browse code

- solaris null string fix for printing the cfg

Andrei Pelinescu-Onciul authored on 14/06/2005 19:11:26
Showing 1 changed files
... ...
@@ -46,6 +46,7 @@
46 46
 #include "dprint.h"
47 47
 #include "ip_addr.h"
48 48
 #include "mem/mem.h"
49
+#include "ut.h" /* ZSW() */
49 50
 
50 51
 
51 52
 struct expr* mk_exp(int op, struct expr* left, struct expr* right)
... ...
@@ -186,7 +187,7 @@ void print_expr(struct expr* exp)
186 186
 					DBG("N/A");
187 187
 					break;
188 188
 			case STRING_ST:
189
-					DBG("\"%s\"", (char*)exp->r.param);
189
+					DBG("\"%s\"", ZSW((char*)exp->r.param));
190 190
 					break;
191 191
 			case NET_ST:
192 192
 					print_net((struct net*)exp->r.param);
... ...
@@ -348,7 +349,7 @@ void print_action(struct action* a)
348 348
 		}
349 349
 		switch(t->p1_type){
350 350
 			case STRING_ST:
351
-					DBG("\"%s\"", t->p1.string);
351
+					DBG("\"%s\"", ZSW(t->p1.string));
352 352
 					break;
353 353
 			case NUMBER_ST:
354 354
 					DBG("%lu",t->p1.number);
... ...
@@ -368,7 +369,7 @@ void print_action(struct action* a)
368 368
 			case SOCKID_ST:
369 369
 					DBG("%d:%s:%d",
370 370
 							((struct socket_id*)t->p1.data)->proto,
371
-							((struct socket_id*)t->p1.data)->name,
371
+							ZSW(((struct socket_id*)t->p1.data)->name),
372 372
 							((struct socket_id*)t->p1.data)->port
373 373
 							);
374 374
 					break;
... ...
@@ -380,7 +381,7 @@ void print_action(struct action* a)
380 380
 			case NOSUBTYPE:
381 381
 					break;
382 382
 			case STRING_ST:
383
-					DBG(", \"%s\"", t->p2.string);
383
+					DBG(", \"%s\"", ZSW(t->p2.string));
384 384
 					break;
385 385
 			case NUMBER_ST:
386 386
 					DBG(", %lu",t->p2.number);
... ...
@@ -394,7 +395,7 @@ void print_action(struct action* a)
394 394
 			case SOCKID_ST:
395 395
 					DBG("%d:%s:%d",
396 396
 							((struct socket_id*)t->p1.data)->proto,
397
-							((struct socket_id*)t->p1.data)->name,
397
+							ZSW(((struct socket_id*)t->p1.data)->name),
398 398
 							((struct socket_id*)t->p1.data)->port
399 399
 							);
400 400
 					break;
... ...
@@ -406,7 +407,7 @@ void print_action(struct action* a)
406 406
 			case NOSUBTYPE:
407 407
 					break;
408 408
 			case STRING_ST:
409
-					DBG(", \"%s\"", t->p3.string);
409
+					DBG(", \"%s\"", ZSW(t->p3.string));
410 410
 					break;
411 411
 			case NUMBER_ST:
412 412
 					DBG(", %lu",t->p3.number);
... ...
@@ -420,7 +421,7 @@ void print_action(struct action* a)
420 420
 			case SOCKID_ST:
421 421
 					DBG("%d:%s:%d",
422 422
 							((struct socket_id*)t->p1.data)->proto,
423
-							((struct socket_id*)t->p1.data)->name,
423
+							ZSW(((struct socket_id*)t->p1.data)->name),
424 424
 							((struct socket_id*)t->p1.data)->port
425 425
 							);
426 426
 					break;