1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00

fix coverage

This commit is contained in:
stefanocasazza 2017-09-28 18:59:26 +02:00
parent cb3ff25402
commit 2823f6abcc
3 changed files with 21 additions and 19 deletions

View File

@ -804,8 +804,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
{
unsigned n = 0;
char* names[1024];
int j, file_num = 0;
unsigned names_len[1024];
int j, file_num = 0, f_fd, handle;
U_INTERNAL_TRACE("zip_extract(%s,%p,%p,%p)", zipfile, files, filenames, filenames_len)
@ -818,7 +818,7 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
for (;;)
{
int f_fd = 0,
f_fd = 0;
handle = 1; /* by default we'll extract/create the file */
U_INTERNAL_ASSERT(n < 1024)
@ -843,15 +843,12 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
}
}
if (handle)
if (handle == 0) f_fd = -1;
else
{
names[n] = strdup((const char*)filename);
names_len[n] = fnlen;
}
else
{
f_fd = -1;
}
/**
* OK, there is some directory information in the file. Nothing to do
@ -859,7 +856,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
* What a pain!
*/
if (strchr((const char*)filename, '/') != 0 && handle)
if (handle &&
strchr((const char*)filename, '/') != 0)
{
/* Loop through all the directories in the path, (everything w/ a '/') */
@ -916,14 +914,15 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
return 0;
}
}
else if (S_ISDIR(sbuf.st_mode))
else
{
if (S_ISDIR(sbuf.st_mode))
{
U_INTERNAL_TRACE("Directory exists")
continue;
}
else
{
U_INTERNAL_TRACE("Hmmm.. %s exists but isn't a directory!", tmp_buff)
free(tmp_buff);
@ -1006,8 +1005,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
(void) write(f_fd, rd_buff, rdamt);
# endif
out_a += rdamt;
in_a -= rdamt;
out_a += rdamt;
U_INTERNAL_TRACE("%d bytes written", out_a)
}

View File

@ -948,8 +948,9 @@ bool UHttpClient_Base::sendRequest()
if (server_context_flag)
{
u_clientimage_info.flag.u = flag_save;
u_clientimage_info.http_info.nResponseCode = U_http_info.nResponseCode;
u_clientimage_info.http_info = http_info_save;
http_info_save.nResponseCode = U_http_info.nResponseCode;
U_http_info = http_info_save;
}
U_INTERNAL_DUMP("server_context_flag = %b U_ClientImage_close = %b", server_context_flag, U_ClientImage_close)

View File

@ -4481,6 +4481,7 @@ file_in_cache:
if (checkIfSourceHasChangedAndCompileUSP())
# endif
{
# ifndef U_COVERITY_FALSE_POSITIVE // FORWARD_NULL
UServletPage* usp = (UServletPage*)file_data->ptr;
U_INTERNAL_ASSERT_POINTER(usp)
@ -4491,6 +4492,7 @@ file_in_cache:
U_DUMP("U_http_info.nResponseCode = %u", U_http_info.nResponseCode)
usp->runDynamicPage(0);
# endif
U_DUMP("U_http_info.nResponseCode = %u U_ClientImage_parallelization = %d UClientImage_Base::isNoHeaderForResponse() = %b",
U_http_info.nResponseCode, U_ClientImage_parallelization, UClientImage_Base::isNoHeaderForResponse())