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 187
 					DBG("N/A");
187 188
 					break;
188 189
 			case STRING_ST:
189
-					DBG("\"%s\"", (char*)exp->r.param);
190
+					DBG("\"%s\"", ZSW((char*)exp->r.param));
190 191
 					break;
191 192
 			case NET_ST:
192 193
 					print_net((struct net*)exp->r.param);
... ...
@@ -348,7 +349,7 @@ void print_action(struct action* a)
348 349
 		}
349 350
 		switch(t->p1_type){
350 351
 			case STRING_ST:
351
-					DBG("\"%s\"", t->p1.string);
352
+					DBG("\"%s\"", ZSW(t->p1.string));
352 353
 					break;
353 354
 			case NUMBER_ST:
354 355
 					DBG("%lu",t->p1.number);
... ...
@@ -368,7 +369,7 @@ void print_action(struct action* a)
368 369
 			case SOCKID_ST:
369 370
 					DBG("%d:%s:%d",
370 371
 							((struct socket_id*)t->p1.data)->proto,
371
-							((struct socket_id*)t->p1.data)->name,
372
+							ZSW(((struct socket_id*)t->p1.data)->name),
372 373
 							((struct socket_id*)t->p1.data)->port
373 374
 							);
374 375
 					break;
... ...
@@ -380,7 +381,7 @@ void print_action(struct action* a)
380 381
 			case NOSUBTYPE:
381 382
 					break;
382 383
 			case STRING_ST:
383
-					DBG(", \"%s\"", t->p2.string);
384
+					DBG(", \"%s\"", ZSW(t->p2.string));
384 385
 					break;
385 386
 			case NUMBER_ST:
386 387
 					DBG(", %lu",t->p2.number);
... ...
@@ -394,7 +395,7 @@ void print_action(struct action* a)
394 395
 			case SOCKID_ST:
395 396
 					DBG("%d:%s:%d",
396 397
 							((struct socket_id*)t->p1.data)->proto,
397
-							((struct socket_id*)t->p1.data)->name,
398
+							ZSW(((struct socket_id*)t->p1.data)->name),
398 399
 							((struct socket_id*)t->p1.data)->port
399 400
 							);
400 401
 					break;
... ...
@@ -406,7 +407,7 @@ void print_action(struct action* a)
406 407
 			case NOSUBTYPE:
407 408
 					break;
408 409
 			case STRING_ST:
409
-					DBG(", \"%s\"", t->p3.string);
410
+					DBG(", \"%s\"", ZSW(t->p3.string));
410 411
 					break;
411 412
 			case NUMBER_ST:
412 413
 					DBG(", %lu",t->p3.number);
... ...
@@ -420,7 +421,7 @@ void print_action(struct action* a)
420 421
 			case SOCKID_ST:
421 422
 					DBG("%d:%s:%d",
422 423
 							((struct socket_id*)t->p1.data)->proto,
423
-							((struct socket_id*)t->p1.data)->name,
424
+							ZSW(((struct socket_id*)t->p1.data)->name),
424 425
 							((struct socket_id*)t->p1.data)->port
425 426
 							);
426 427
 					break;