Skip to content

Commit 7c24e9a

Browse files
committed
luzer: reduce variables scope
1 parent 51d0216 commit 7c24e9a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

luzer/fuzzed_data_provider.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,10 @@ luaL_consume_strings(lua_State *L)
6262
size_t count = luaL_checkinteger(L, 2);
6363
size_t max_length = luaL_checkinteger(L, 3);
6464

65-
std::string str;
66-
const char *cstr;
67-
6865
lua_newtable(L);
6966
for (int i = 1; i <= (int)count; i++) {
70-
str = lfdp->fdp->ConsumeRandomLengthString(max_length);
71-
cstr = str.c_str();
67+
std::string str = lfdp->fdp->ConsumeRandomLengthString(max_length);
68+
const char *cstr = str.c_str();
7269
lua_pushnumber(L, i);
7370
lua_pushlstring(L, cstr, str.length());
7471
lua_settable(L, -3);

0 commit comments

Comments
 (0)