X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=contrib%2Flar%2Flarlib.c;h=aa9280a093f0c2149251b5764a67202450ee8f1e;hp=5467ed5b98b05d3623098da2e9ccb1ebe53d7684;hb=df11154ba3b73defc5357794dfa84be31f1aec4b;hpb=eb4a870be600f3f8704737278ef75c7d050f7172 diff --git a/contrib/lar/larlib.c b/contrib/lar/larlib.c index 5467ed5b9..aa9280a09 100644 --- a/contrib/lar/larlib.c +++ b/contrib/lar/larlib.c @@ -145,7 +145,7 @@ static int larlib_mkpath( const char *name, const char *path, char *buffer ) int nlen = strlen(name); int plen = strlen(path); - if( (nlen + plen + 1) <= 1024 ) + if( (nlen + plen + 1) <= LAR_FNAME_BUFFER ) { strcpy(buffer, path); @@ -451,10 +451,10 @@ int larlib_findfile( lua_State *L ) int i; const char *filename = luaL_checkstring( L, 1 ); const char *basepath = luaL_optstring( L, 2, "./" ); - char filepath[1024]; struct stat s; lar_archive *ar; lar_member *mb; + LAR_FNAME(filepath); const char *searchpath[3] = { basepath, LUA_LDIR, LUA_CDIR };