even more beauty sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 18:09:45 +0200
branchsync
changeset 3091ee2e7d1e0601
parent 3090 8adef1192b4e
child 3096 89d9de21bc2a
even more beauty
src/pgp_gpg.c
     1.1 --- a/src/pgp_gpg.c	Sun Oct 21 18:01:57 2018 +0200
     1.2 +++ b/src/pgp_gpg.c	Sun Oct 21 18:09:45 2018 +0200
     1.3 @@ -16,7 +16,6 @@
     1.4  
     1.5  static bool ensure_config_values(stringlist_t *keys, stringlist_t *values, const char* config_file_path)
     1.6  {
     1.7 -    static char buf[MAX_LINELENGTH];
     1.8      int r;
     1.9      stringlist_t *_k;
    1.10      stringlist_t *_v;
    1.11 @@ -24,8 +23,6 @@
    1.12      unsigned int found = 0;
    1.13      bool eof_nl = 0;
    1.14      char * rest = NULL;
    1.15 -    char * token;
    1.16 -    char * s;
    1.17      const char* line_end;
    1.18  
    1.19  #ifdef WIN32
    1.20 @@ -39,7 +36,9 @@
    1.21          return false;
    1.22  
    1.23      if (f != NULL) {
    1.24 +        static char buf[MAX_LINELENGTH];
    1.25          int length = stringlist_length(keys);
    1.26 +        char * s;
    1.27  
    1.28          // make sure we 1) have the same number of keys and values
    1.29          // and 2) we don't have more key/value pairs than
    1.30 @@ -55,7 +54,7 @@
    1.31          }
    1.32  
    1.33          while ((s = Fgets(buf, MAX_LINELENGTH, f))) {
    1.34 -            token = strtok_r(s, " \t\r\n", &rest);
    1.35 +            char *token = strtok_r(s, " \t\r\n", &rest);
    1.36              for (_k = keys, _v = values, i = 1;
    1.37                   _k != NULL;
    1.38                   _k = _k->next, _v = _v->next, i <<= 1) {