Index: trunk/Ohana/src/opihi/cmd.data/queuepop.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/queuepop.c	(revision 7917)
+++ trunk/Ohana/src/opihi/cmd.data/queuepop.c	(revision 8190)
@@ -3,5 +3,6 @@
 int queuepop (int argc, char **argv) {
   
-  int N, Key;
+  int N;
+  char *Key;
   char *var;
   char *line;
@@ -16,8 +17,8 @@
   }
 
-  Key = -1;
+  Key = NULL;
   if ((N = get_argument (argc, argv, "-key"))) {
     remove_argument (N, &argc, argv);
-    Key = atoi (argv[N]);
+    Key = strcreate (argv[N]);
     remove_argument (N, &argc, argv);
     Value = strcreate (argv[N]);
@@ -38,18 +39,18 @@
   }
 
-  if (Key == -1) {
-      line = PopQueue (queue);
+  if (Key == NULL) {
+    line = PopQueue (queue);
   } else {
-      line = PopQueueMatch (queue, Key, Value);
+    line = PopQueueMatch (queue, Key, Value);
   }
 
   if (var == NULL) {
-      if (line == NULL) {
-	  gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
-	  return (FALSE);
-      } else {
-	  gprint (GP_ERR, "%s\n", line);
-	  return (TRUE);
-      }
+    if (line == NULL) {
+      gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
+      return (FALSE);
+    } else {
+      gprint (GP_ERR, "%s\n", line);
+      return (TRUE);
+    }
   }
 
@@ -61,4 +62,6 @@
 
   free (line);
+  if (Key != NULL) free (Key);
+
   return (TRUE);
 }
