diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-04 08:48:23 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-04 08:48:23 +0000 |
commit | b1fa75dfe08461c0f1349093266bcdc852bcd713 (patch) | |
tree | f9d3d7950c6e72d1c0d05d6ea4f0a6dff2346ab9 /src/htsparse.c | |
parent | 4da59a639962cecf3599f19813b00f2ab065e089 (diff) |
Big cleanup in string primitives and abort functions
Diffstat (limited to 'src/htsparse.c')
-rw-r--r-- | src/htsparse.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/htsparse.c b/src/htsparse.c index 606ecb6..23d7dd2 100644 --- a/src/htsparse.c +++ b/src/htsparse.c @@ -77,12 +77,14 @@ Please visit our Website: http://www.httrack.com // version optimisée, qui permet de ne pas toucher aux html non modifiés (update) #define REALLOC_SIZE 8192 #define HT_ADD_CHK(A) if (((int) (A)+ht_len+1) >= ht_size) { \ + char message[256]; \ ht_size=(A)+ht_len+REALLOC_SIZE; \ ht_buff=(char*) realloct(ht_buff,ht_size); \ if (ht_buff==NULL) { \ printf("PANIC! : Not enough memory [%d]\n", __LINE__); \ XH_uninit; \ - abortLogFmt("not enough memory for current html document in HT_ADD_CHK : realloct("LLintP") failed" _ (LLint) ht_size); \ + snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_CHK : realloct("LLintP") failed", (LLint) ht_size); \ + abortLog(message); \ abort(); \ } \ } \ @@ -127,6 +129,7 @@ Please visit our Website: http://www.httrack.com ht_buff[j_+i_]='\0'; \ } } #define HT_ADD_START \ + char message[256]; \ size_t ht_size=(size_t)(r->size*5)/4+REALLOC_SIZE; \ size_t ht_len=0; \ char* ht_buff=NULL; \ @@ -135,7 +138,8 @@ Please visit our Website: http://www.httrack.com if (ht_buff==NULL) { \ printf("PANIC! : Not enough memory [%d]\n",__LINE__); \ XH_uninit; \ - abortLogFmt("not enough memory for current html document in HT_ADD_START : malloct("LLintP") failed" _ (LLint) ht_size); \ + snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_START : malloct("LLintP") failed", (LLint) ht_size); \ + abortLog(message); \ abort(); \ } \ ht_buff[0]='\0'; \ |