Changeset df9ad581c5767cba988269e70126a35992d71b39

Show
Ignore:
Timestamp:
11/08/10 19:52:37 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1289245957 +0000
git-parent:

[9c846a29d6454bfe2d4465c139f488db05f832df]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1289245957 +0000
Message:

fixes #325.... and... lua sucks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/lua.c

    rc14d5c4 rdf9ad58  
    289289  metric_type_t metric_type; 
    290290 
    291   double __n
    292   int32_t __i
    293   u_int32_t __I
    294   int64_t __l
    295   u_int64_t __L
     291  double __n = 0.0
     292  int32_t __i = 0
     293  u_int32_t __I = 0
     294  int64_t __l = 0
     295  u_int64_t __L = 0
    296296 
    297297  if(lua_gettop(L) != 2) luaL_error(L, "wrong number of arguments"); 
     
    327327      break; 
    328328    case METRIC_INT32: 
    329       __i = luaL_optinteger(L, 2, 0); 
     329      __i = strtol(lua_tostring(L, 2), NULL, 10); 
    330330      noit_stats_set_metric(&ci->current, metric_name, metric_type, &__i); 
    331331      break; 
    332332    case METRIC_UINT32: 
    333       __I = luaL_optinteger(L, 2, 0); 
     333      __I = strtoul(lua_tostring(L, 2), NULL, 10); 
    334334      noit_stats_set_metric(&ci->current, metric_name, metric_type, &__I); 
    335335      break; 
    336336    case METRIC_INT64: 
    337       __l = luaL_optinteger(L, 2, 0); 
     337      __l = strtoll(lua_tostring(L, 2), NULL, 10); 
    338338      noit_stats_set_metric(&ci->current, metric_name, metric_type, &__l); 
    339339      break; 
    340340    case METRIC_UINT64: 
    341       __L = luaL_optinteger(L, 2, 0); 
     341      __L = strtoull(lua_tostring(L, 2), NULL, 10); 
    342342      noit_stats_set_metric(&ci->current, metric_name, metric_type, &__L); 
    343343      break;