]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Improving sql_gooddata
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 29 Jun 2025 01:08:49 +0000 (21:08 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 29 Jun 2025 01:08:49 +0000 (21:08 -0400)
lib/devsql.c

index 30d2fd585a952bf156a739ebff1896559955984a..9bf939b6db1401e53034d5efdcba3648b1522c33 100644 (file)
@@ -510,13 +510,16 @@ phase=0;
 proceed=true;
 while (proceed==true) {
   switch (phase) {
-    case 0      :       //do we have a string
-      if ((key==(char *)0)||(strlen(key)==0)) 
-        key="NULL";     //no, force a 'NULL' string.
+    case 0      :       //do we have a string to encode
+      if ((key==(char *)0)||(strlen(key)==0)) {
+        gooddata=strdup("NULL");    //no, force a 'NULL' string.
+        phase=999;
+        }
       break;
     case 1      :       //checking the key encoding
       if ((sqlkey=sql_checkencoding(key))==(char *)0) {
         (void) rou_alert(0,"%s dbkey <%s> encoding is wrong (config?)",OPEP,key);
+        gooddata=strdup("NULL");    //Let assum NULL
         phase=999;      //trouble trouble
         }
       break;