OSSP CVS Repository

ossp - Check-in [862]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 862
Date: 2001-Sep-05 15:34:58 (local)
2001-Sep-05 13:34:58 (UTC)
User:rse
Branch:
Comment: fix L2_TYPE_STRING: argument can be NULL
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ut_param.c      1.2 -> 1.3     3 inserted, 1 deleted

ossp-pkg/l2/l2_ut_param.c 1.2 -> 1.3

--- l2_ut_param.c        2001/09/05 07:41:18     1.2
+++ l2_ut_param.c        2001/09/05 13:34:58     1.3
@@ -86,7 +86,9 @@
                         *(double *)(pa[i].store) = va_get(ap, double); 
                         break;
                     case L2_TYPE_STRING:
-                        *(char **)(pa[i].store) = strdup(va_get(ap, charptr)); 
+                        *(char **)(pa[i].store) = va_get(ap, charptr);
+                        if (*(char **)(pa[i].store) != NULL)
+                            *(char **)(pa[i].store) = strdup(*(char **)(pa[i].store));
                         break;
                     case L2_TYPE_CHARPTR:
                         *(char **)(pa[i].store) = va_get(ap, charptr); 

CVSTrac 2.0.1