summaryrefslogtreecommitdiffstats
path: root/core/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/parse.c')
-rw-r--r--core/parse.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/parse.c b/core/parse.c
index 3335b8f57..57f6eb019 100644
--- a/core/parse.c
+++ b/core/parse.c
@@ -12,6 +12,7 @@
#include "gettext.h"
int metric = 1;
+int diveid = -1;
/*
static union {
@@ -516,3 +517,15 @@ void add_dive_site(char *ds_name, struct dive *dive)
free(to_free);
}
+int atoi_n(char *ptr, unsigned int len)
+{
+ if (len < 10) {
+ char buf[10];
+
+ memcpy(buf, ptr, len);
+ buf[len] = 0;
+ return atoi(buf);
+ }
+ return 0;
+}
+