summaryrefslogtreecommitdiffstats
path: root/source/helper.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-05-16 13:58:09 +0200
committerQC <qball@gmpclient.org>2015-05-16 13:58:09 +0200
commit354ccdd94d2c08dd1399496a96102433c409e9e9 (patch)
tree0990845fb352767d56882c2e244d9fb0a855b7b0 /source/helper.c
parent571aca98341bd36bcf1045eef1d6bac7f3469600 (diff)
Fix Issue #164
Diffstat (limited to 'source/helper.c')
-rw-r--r--source/helper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/helper.c b/source/helper.c
index 02262268..47127866 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -226,6 +226,19 @@ int find_arg_str ( const char * const key, char** val )
}
return FALSE;
}
+int find_arg_str_alloc ( const char * const key, char** val )
+{
+ int i = find_arg ( key );
+
+ if ( val != NULL && i > 0 && i < stored_argc - 1 ) {
+ if ( *val != NULL ) {
+ g_free ( *val );
+ }
+ *val = g_strdup ( stored_argv[i + 1] );
+ return TRUE;
+ }
+ return FALSE;
+}
int find_arg_int ( const char * const key, int *val )
{