@@ -435,7 +435,7 @@ static void process_get_command(conn *c, LIBEVENT_THREAD *t, mcp_parser_t *pr, p
435
435
436
436
if (should_touch ) {
437
437
int32_t exptime_int = 0 ;
438
- if (!safe_strtol ( & pr -> request [ pr -> tok . tokens [ 1 ]] , & exptime_int )) {
438
+ if (!mc_tokto32 ( pr , 1 , & exptime_int )) {
439
439
out_string (c , "CLIENT_ERROR invalid exptime argument" );
440
440
return ;
441
441
}
@@ -893,19 +893,15 @@ static void process_slabs_automove_command(conn *c, mcp_parser_t *pr) {
893
893
894
894
const char * subcmd = mcmc_token_get (pr -> request , & pr -> tok , 2 , & len );
895
895
if (strncmp (subcmd , "ratio" , len ) == 0 ) {
896
- int vlen = 0 ;
897
- const char * val = mcmc_token_get (pr -> request , & pr -> tok , 3 , & vlen );
898
- if (ntokens < 4 || !safe_strtod (val , & ratio )) {
896
+ if (ntokens < 4 || !mc_toktod (pr , 3 , & ratio )) {
899
897
out_string (c , "ERROR" );
900
898
return ;
901
899
}
902
900
// TODO: settings needs an overhaul... no locks/etc.
903
901
settings .slab_automove_ratio = ratio ;
904
902
settings .slab_automove_version ++ ;
905
903
} else if (strncmp (subcmd , "freeratio" , len ) == 0 ) {
906
- int vlen = 0 ;
907
- const char * val = mcmc_token_get (pr -> request , & pr -> tok , 3 , & vlen );
908
- if (ntokens < 4 || !safe_strtod (val , & ratio )) {
904
+ if (ntokens < 4 || !mc_toktod (pr , 3 , & ratio )) {
909
905
out_string (c , "ERROR" );
910
906
return ;
911
907
}
0 commit comments