Add patch by Stephan Beyer to improve process_keys' input parsing,
[pgp-tools.git] / keyanalyze / process_keys.c
index acf5c89a3fcf2fdbbea581bcb083e9401f7ebb15..1472a3256e0835ee093da8b96df31a8d74c28998 100644 (file)
@@ -184,7 +184,7 @@ int main (int argc, char *argv[])
 
   while (fgets (buff, sizeof (buff), stdin))
   {
-    if ((s = strtok (buff, " \t\r\n")))
+    if ((s = strtok (buff, ":")))
     {
       if (!strcmp (s, "pub"))
       {
@@ -194,8 +194,12 @@ int main (int argc, char *argv[])
 
        lastuid = &k->uids->next;
        lastsig = &k->uids->sigs;
-       
-       sprintf (k->id, "%.16s", strtok (NULL, " \t\r\n"));
+
+       strtok (NULL, ":");
+       strtok (NULL, ":");
+       strtok (NULL, ":");
+
+       sprintf (k->id, "%s", strtok (NULL, ":"));
       }
       else if (!strcmp (s, "rev"))
        k->rev = 1;
@@ -209,7 +213,7 @@ int main (int argc, char *argv[])
       {
        struct sig *sig = *lastsig = new_sig();
        lastsig = &sig->next;
-       sprintf (sig->id, "%.16s", strtok (NULL, " \t\r\n"));
+       sprintf (sig->id, "%s", strtok (NULL, ":"));
       }
     }
   }