diff options
| -rw-r--r-- | src/random.c | 3 | ||||
| -rw-r--r-- | src/term.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/random.c b/src/random.c index 5a07e0d..4c92745 100644 --- a/src/random.c +++ b/src/random.c | |||
| @@ -60,7 +60,6 @@ static int lua_get_random_bytes(lua_State* L) { | |||
| 60 | return 2; | 60 | return 2; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | ssize_t n; | ||
| 64 | ssize_t total_read = 0; | 63 | ssize_t total_read = 0; |
| 65 | 64 | ||
| 66 | #ifdef _WIN32 | 65 | #ifdef _WIN32 |
| @@ -99,7 +98,7 @@ static int lua_get_random_bytes(lua_State* L) { | |||
| 99 | } | 98 | } |
| 100 | 99 | ||
| 101 | while (total_read < num_bytes) { | 100 | while (total_read < num_bytes) { |
| 102 | n = read(fd, buffer + total_read, num_bytes - total_read); | 101 | ssize_t n = read(fd, buffer + total_read, num_bytes - total_read); |
| 103 | 102 | ||
| 104 | if (n < 0) { | 103 | if (n < 0) { |
| 105 | if (errno == EINTR) { | 104 | if (errno == EINTR) { |
| @@ -1226,6 +1226,8 @@ static int lst_setconsolecp(lua_State *L) { | |||
| 1226 | int success = TRUE; | 1226 | int success = TRUE; |
| 1227 | #ifdef _WIN32 | 1227 | #ifdef _WIN32 |
| 1228 | SetConsoleCP(cp); | 1228 | SetConsoleCP(cp); |
| 1229 | #else | ||
| 1230 | (void)cp; | ||
| 1229 | #endif | 1231 | #endif |
| 1230 | lua_pushboolean(L, success); | 1232 | lua_pushboolean(L, success); |
| 1231 | return 1; | 1233 | return 1; |
| @@ -1262,6 +1264,8 @@ static int lst_setconsoleoutputcp(lua_State *L) { | |||
| 1262 | int success = TRUE; | 1264 | int success = TRUE; |
| 1263 | #ifdef _WIN32 | 1265 | #ifdef _WIN32 |
| 1264 | SetConsoleOutputCP(cp); | 1266 | SetConsoleOutputCP(cp); |
| 1267 | #else | ||
| 1268 | (void)cp; | ||
| 1265 | #endif | 1269 | #endif |
| 1266 | lua_pushboolean(L, success); | 1270 | lua_pushboolean(L, success); |
| 1267 | return 1; | 1271 | return 1; |
