Welcome to little lamb

Code » ssp » commit 823bdaf

import: Make sure all settings have defaults

author Olivier Brunel
2023-08-20 14:42:33 UTC
committer Olivier Brunel
2023-08-20 14:55:39 UTC
parent 121efff03bc1a6cb1bd988eec2badf1266731f6d

import: Make sure all settings have defaults

src/ssp/import.c +3 -3

diff --git a/src/ssp/import.c b/src/ssp/import.c
index 6a834fa..ea21b9e 100644
--- a/src/ssp/import.c
+++ b/src/ssp/import.c
@@ -87,6 +87,7 @@ import_main(int argc, const char *argv[], const char *env[], const char usage[],
         diefusys(exitcode_from_errno(errno), "read ", ESC, ssp->sa.s + ctx.fileoff, ESC);
 
     cdbmaker_sa mkr = CDBMAKER_SA_ZERO;
+    struct otp otp_default = OTP_DEFAULT;
     struct otp otp;
     const char *name = NULL;
     size_t nlen = 0;
@@ -98,6 +99,7 @@ import_main(int argc, const char *argv[], const char *env[], const char usage[],
     struct copa copa;
     int r, n = 0;
     dbg("init parsing");
+    otp = otp_default;
     comments = NULL; clen = 0; /* silence warnings */
     copa_init(sacopa.s, sacopa.len, &copa);
     while ((r = copa_next(&copa)) >= 0) {
@@ -164,9 +166,7 @@ import_main(int argc, const char *argv[], const char *env[], const char usage[],
             dbg("resetting new entry");
             name = copa_name(&copa);
             nlen = copa_nlen(&copa);
-            otp.algo = ALGO_SHA256;
-            otp.type = TYPE_COUNTER;
-            otp.digits = 6;
+            otp = otp_default;
             comments = "";
             slen = clen = 0;
         } else if (!name) {