From 95984628302bee02af3e82ac305b5e3bb4842533 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 17 Apr 2014 11:34:21 -0300 Subject: Removed the globals 'userid' and 'save_userid_local' variables This is a preferences setting, it should belong to the preferences structure. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- dive.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dive.c') diff --git a/dive.c b/dive.c index 9a836038d..48fd020ef 100644 --- a/dive.c +++ b/dive.c @@ -2,6 +2,7 @@ /* maintains the internal dive list structure */ #include #include +#include #include #include "gettext.h" #include "dive.h" @@ -2188,3 +2189,17 @@ timestamp_t get_times() } return dive->when; } + +#define MAX_USERID_SIZE 32 +void set_save_userid_local(short value) +{ + prefs.save_userid_local = value; +} + +void set_userid(char *rUserId) +{ + prefs.userid = (char *) malloc(MAX_USERID_SIZE); + if (prefs.userid && rUserId) + strcpy(prefs.userid, rUserId); +} +#undef MAX_USERID_SIZE \ No newline at end of file -- cgit v1.2.3-70-g09d2