summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htscharset.c3
-rw-r--r--src/htscore.c4
-rw-r--r--src/htscoremain.c5
-rw-r--r--src/htslib.c4
-rw-r--r--src/htsserver.c8
-rw-r--r--src/md5.c5
6 files changed, 19 insertions, 10 deletions
diff --git a/src/htscharset.c b/src/htscharset.c
index 8f96b85..f19e47c 100644
--- a/src/htscharset.c
+++ b/src/htscharset.c
@@ -35,6 +35,7 @@ Please visit our Website: http://www.httrack.com
/* ------------------------------------------------------------ */
#include "htscharset.h"
+#include "htsbase.h"
static int hts_isStringAscii(const char *s, size_t size) {
size_t i;
@@ -455,7 +456,7 @@ char *hts_convertStringFromUTF8(const char *s, size_t size, const char *charset)
#endif
-static char* hts_getCharsetFromContentType(const char *mime) {
+HTS_STATIC char* hts_getCharsetFromContentType(const char *mime) {
/* text/html; charset=utf-8 */
const char *const charset = "charset";
char *pos = strstr(mime, charset);
diff --git a/src/htscore.c b/src/htscore.c
index a67fcde..4973479 100644
--- a/src/htscore.c
+++ b/src/htscore.c
@@ -2856,7 +2856,9 @@ void usercommand_exe(const char* cmd,const char* file) {
strcatbuff(temp,c);
}
}
- system(temp);
+ if (system(temp) == -1) {
+ assertf(! "can not spawn process"); \
+ }
}
diff --git a/src/htscoremain.c b/src/htscoremain.c
index 0f2da28..75c34fe 100644
--- a/src/htscoremain.c
+++ b/src/htscoremain.c
@@ -1733,7 +1733,10 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp *opt) {
htsmain_free();
return -1;
} else {
- system(argv[na+1]);
+ int code;
+ if ((code = system(argv[na+1])) != 0) {
+ fprintf(stderr, "process returned error code %d\n", code);
+ }
}
break;
case 'd':
diff --git a/src/htslib.c b/src/htslib.c
index f98adff..1a95a67 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -885,7 +885,9 @@ int http_sendhead(httrackp *opt,t_cookie* cookie,int mode,char* xsend,char* adr,
else
sprintf(buff,"%s %s %s\r\n",method,url,protocol);
// lire le reste en brut
- fread(buff+strlen(buff),8000-strlen(buff),1,fp);
+ if (fread(buff+strlen(buff),8000-strlen(buff),1,fp) < 0) {
+ return -1;
+ }
}
fclose(fp);
}
diff --git a/src/htsserver.c b/src/htsserver.c
index 609fd41..1698955 100644
--- a/src/htsserver.c
+++ b/src/htsserver.c
@@ -503,7 +503,7 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
/* path : <path>/<project> */
if (!commandRunning) {
- intptr_t adrw = 0, adrpath = 0, adrprojname = 0;
+ intptr_t adrpath = 0, adrprojname = 0;
if (inthash_readptr(NewLangList, "path", &adrpath)
&& inthash_readptr(NewLangList, "projname", &adrprojname)) {
StringClear(fspath);
@@ -599,7 +599,7 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
if (!commandRunning) {
intptr_t adrcd = 0;
if (inthash_readptr(NewLangList, "command_do", &adrcd)) {
- intptr_t adrw = 0, adrpath = 0, adrprojname = 0;
+ intptr_t adrw = 0, adrpath = 0;
if (inthash_readptr(NewLangList, "winprofile", &adrw)) {
/* User general profile */
@@ -1281,7 +1281,6 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
int htslang_init(void) {
if (NewLangList==NULL) {
- int i = 0;
NewLangList=inthash_new(NewLangListSz);
if (NewLangList==NULL) {
abortLog("Error in lang.h: not enough memory");
@@ -1528,7 +1527,7 @@ static void LANG_DELETE(void) {
static void LANG_INIT(char* path) {
//CWinApp* pApp = AfxGetApp();
//if (pApp) {
- int test = 0; /* pApp->GetProfileInt("Language","IntId",0); */
+ /* pApp->GetProfileInt("Language","IntId",0); */
LANG_T(path, 0 /*pApp->GetProfileInt("Language","IntId",0)*/ );
//}
}
@@ -1563,7 +1562,6 @@ static int LANG_LIST(char* path, char* buffer) {
char lang_str[1024];
int i = 0;
int curr_lng=LANG_T(path, -1);
- int found = 0;
buffer[0] = '\0';
do {
QLANG_T(i);
diff --git a/src/md5.c b/src/md5.c
index f5dadf2..159933a 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -159,8 +159,11 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
+ /* Note: see patch for PAM from Tomas Mraz */
+ memcpy((uint32 *)ctx->in + 14, ctx->bits, 2*sizeof(uint32));
+ /*((uint32 *) ctx->in)[14] = ctx->bits[0];
((uint32 *) ctx->in)[15] = ctx->bits[1];
+ */
MD5Transform(ctx->buf, (uint32 *) ctx->in);
if (ctx->doByteReverse)