gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: repaired loop and parsing...


From: gnunet
Subject: [taler-anastasis] branch master updated: repaired loop and parsing...
Date: Tue, 19 May 2020 15:04:18 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 40949e3  repaired loop and parsing...
40949e3 is described below

commit 40949e3e64a8e7f87c4b21d7ebc54f5acaf772d7
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue May 19 13:04:14 2020 +0000

    repaired loop and parsing...
---
 src/cli/anastasis-cli-splitter.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index 69d82d8..1140a74 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -530,7 +530,7 @@ read_keyboard_command (void *cls)
                         token,
                         strlen ("server#")))
       {
-        server_num = (int) token[strlen ("server#x")];
+        server_num = (int) token[strlen ("server#")] - 48;
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     "At %s:%d server is %s\n", __FILE__, __LINE__,
                     token);
@@ -549,14 +549,15 @@ read_keyboard_command (void *cls)
         {
           if (0 == strcmp ("question", method))
           {
-            token = strtok (NULL, " ");
+            token = strtok (NULL, "\"");
             char *question = GNUNET_malloc (strlen (token));
             strcpy (question, token);
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                         "At %s:%d question is %s\n", __FILE__, __LINE__,
                         question);
 
-            token = strtok (NULL, " ");
+            token = strtok (NULL, "\"");
+            token = strtok (NULL, "\"");
             char *answer = GNUNET_malloc (strlen (token));
             strcpy (answer, token);
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -618,12 +619,14 @@ read_keyboard_command (void *cls)
     {
       for (unsigned int i = 0; i < tu_states_length; i++)
       {
-        if (0 == strcmp ("SMS", tu_states[i].method))
+        if ((NULL != tu_states[i].method) &&
+            (0 == strcmp ("SMS", tu_states[i].method)))
           printf ("truth#%u: %s %s\n",
                   i,
                   tu_states[i].method,
                   tu_states[i].phone);
-        if (0 == strcmp ("Secure-Question", tu_states[i].method))
+        if ((NULL != tu_states[i].method) &&
+            (0 == strcmp ("Secure-Question", tu_states[i].method)))
         {
           printf ("truth#%u: %s \"%s\" \"%s\"\n",
                   i,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]