X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/38c4979dae8b7a215d356ceaa5a386ccbb126e38..254b70a4afb07e6ec0f8b1b300df488337bbebc3:/client/util.c?ds=sidebyside diff --git a/client/util.c b/client/util.c index cbb1bfda..be947b8a 100644 --- a/client/util.c +++ b/client/util.c @@ -166,7 +166,7 @@ uint64_t param_get64ex(const char *line, int paramnum, int deflt, int base) int bg, en; if (!param_getptr(line, &bg, &en, paramnum)) - return strtol(&line[bg], NULL, base); + return strtoll(&line[bg], NULL, base); else return deflt; @@ -194,3 +194,15 @@ int param_gethex(const char *line, int paramnum, uint8_t * data, int hexcnt) return 0; } + +int param_getstr(const char *line, int paramnum, char * str) +{ + int bg, en; + + if (param_getptr(line, &bg, &en, paramnum)) return 0; + + memcpy(str, line + bg, en - bg + 1); + str[en - bg + 1] = 0; + + return en - bg + 1; +}