aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pklib/implode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pklib/implode.c b/src/pklib/implode.c
index 90cb482..1484ee2 100644
--- a/src/pklib/implode.c
+++ b/src/pklib/implode.c
@@ -12,6 +12,7 @@
#include <assert.h>
#include <string.h>
+#include <limits.h>
#include "pklib.h"
@@ -292,7 +293,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
// The last repetition is the best one.
//
- pWork->offs09BC[0] = 0xFFFF;
+ pWork->offs09BC[0] = USHRT_MAX;
pWork->offs09BC[1] = 0x0000;
di_val = 0;
@@ -303,7 +304,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
if(input_data[offs_in_rep] != input_data[di_val])
{
di_val = pWork->offs09BC[di_val];
- if(di_val != 0xFFFF)
+ if(di_val != USHRT_MAX)
continue;
}
pWork->offs09BC[++offs_in_rep] = ++di_val;
@@ -322,7 +323,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
for(;;)
{
rep_length2 = pWork->offs09BC[rep_length2];
- if(rep_length2 == 0xFFFF)
+ if(rep_length2 == USHRT_MAX)
rep_length2 = 0;
// Get the pointer to the previous repetition
@@ -395,7 +396,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
if(input_data[offs_in_rep] != input_data[di_val])
{
di_val = pWork->offs09BC[di_val];
- if(di_val != 0xFFFF)
+ if(di_val != USHRT_MAX)
continue;
}
pWork->offs09BC[++offs_in_rep] = ++di_val;