]> git.deb.at Git - pkg/abook.git/blobdiff - misc.c
New index_format option.
[pkg/abook.git] / misc.c
diff --git a/misc.c b/misc.c
index 01bdd545095073254211065d076f4930a9b11b3f..f72475da74287ffee67c43666fc49e6a91dc7283 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -64,6 +64,19 @@ strtrim(char *s)
        return s;
 }
 
+int
+is_number(char *p)
+{
+       if(!p || !*p || (*p == '-' && !*++p))
+               return 0;
+
+       for(; *p; p++)
+               if(!isdigit(*p))
+                       return 0;
+
+       return 1;
+}
+
 
 #ifdef HAVE_CONFIG_H
 #      include "config.h"