Software / code / prosody
Comparison
util-src/pposix.c @ 5777:c98f11bcd0ea
util.pposix: Fix overflow in rlimit argument conversion (thanks gcc, now be quiet please)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Aug 2013 19:02:52 +0200 |
| parent | 5720:449399a7e136 |
| child | 5814:5cf1c08805fb |
comparison
equal
deleted
inserted
replaced
| 5776:bd0ff8ae98a8 | 5777:c98f11bcd0ea |
|---|---|
| 489 if (!strcmp(s, "NICE")) return RLIMIT_NICE; | 489 if (!strcmp(s, "NICE")) return RLIMIT_NICE; |
| 490 #endif | 490 #endif |
| 491 return -1; | 491 return -1; |
| 492 } | 492 } |
| 493 | 493 |
| 494 int arg_to_rlimit(lua_State* L, int idx, rlim_t current) { | 494 unsigned long int arg_to_rlimit(lua_State* L, int idx, rlim_t current) { |
| 495 switch(lua_type(L, idx)) { | 495 switch(lua_type(L, idx)) { |
| 496 case LUA_TSTRING: | 496 case LUA_TSTRING: |
| 497 if(strcmp(lua_tostring(L, idx), "unlimited") == 0) | 497 if(strcmp(lua_tostring(L, idx), "unlimited") == 0) |
| 498 return RLIM_INFINITY; | 498 return RLIM_INFINITY; |
| 499 case LUA_TNUMBER: | 499 case LUA_TNUMBER: |