langclass/fpdb.conf |    2 +-
 src/Makefile.am     |    4 ++--
 src/createfp.c      |   11 +++++++----
 src/fingerprint.c   |    6 ++++--
 src/testtextcat.c   |   11 +++++++----
 src/wg_mempool.c    |    1 +
 src/wg_mempool.h    |    2 +-
 7 files changed, 23 insertions(+), 14 deletions(-)

New commits:
commit b99b1460bb0cda0ffd8f89adc627a0421b24df76
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Nov 8 10:42:42 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Nov 8 10:42:42 2026 +0000

    check the first allocation in createfp and testtextcat
    
    and stop reading on a read error of the given file, not on EOF of stdin
    
    Change-Id: Ie73c081205399dafa0928cea3bc2909a9aea00d9

diff --git a/src/createfp.c b/src/createfp.c
index c75fbb6..9045c8e 100644
--- a/src/createfp.c
+++ b/src/createfp.c
@@ -53,10 +53,9 @@ char *myread(FILE * fp)
     size_t maxsize = BLOCKSIZE * 2;
 
     buf = (char *)malloc(maxsize);
-    do
+    while (buf && !feof(fp) && !ferror(fp))
     {
-        size_t hasread = fread(buf + size, 1, BLOCKSIZE, fp);
-        size += hasread;
+        size += fread(buf + size, 1, BLOCKSIZE, fp);
         if (size + BLOCKSIZE > maxsize)
         {
             maxsize *= 2;
@@ -65,9 +64,13 @@ char *myread(FILE * fp)
                 free(buf);
             buf = newbuf;
         }
+    }
 
+    if (buf && ferror(fp))
+    {
+        free(buf);
+        buf = NULL;
     }
-    while (!feof(stdin) && buf);
 
     if (buf)
     {
diff --git a/src/testtextcat.c b/src/testtextcat.c
index e2b7bc4..a1f8e64 100644
--- a/src/testtextcat.c
+++ b/src/testtextcat.c
@@ -54,10 +54,9 @@ char *myread(FILE * fp)
     size_t maxsize = BLOCKSIZE * 2;
 
     buf = (char *)malloc(maxsize);
-    do
+    while (buf && !feof(fp) && !ferror(fp))
     {
-        size_t hasread = fread(buf + size, 1, BLOCKSIZE, fp);
-        size += hasread;
+        size += fread(buf + size, 1, BLOCKSIZE, fp);
         if (size + BLOCKSIZE > maxsize)
         {
             maxsize *= 2;
@@ -66,9 +65,13 @@ char *myread(FILE * fp)
                 free(buf);
             buf = newbuf;
         }
+    }
 
+    if (buf && ferror(fp))
+    {
+        free(buf);
+        buf = NULL;
     }
-    while (!feof(stdin) && buf);
 
     if (buf)
     {
commit 1fdcaf42edd88742d1a88693425681de5a71bebb
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Nov 8 10:42:42 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Nov 8 10:42:42 2026 +0000

    declare wgmempool_Init with the size_t its definition takes
    
    and include wg_mempool.h in wg_mempool.c so the compiler compares the two
    
    Change-Id: I15e5aee89077ee089004e73eb30c32bad1252ab3

diff --git a/src/wg_mempool.c b/src/wg_mempool.c
index 27d2dc9..5460935 100644
--- a/src/wg_mempool.c
+++ b/src/wg_mempool.c
@@ -40,6 +40,7 @@
 #endif
 #include <string.h>
 #include "common_impl.h"
+#include "wg_mempool.h"
 
 typedef struct memblock_s
 {
diff --git a/src/wg_mempool.h b/src/wg_mempool.h
index 1041a84..4702c04 100644
--- a/src/wg_mempool.h
+++ b/src/wg_mempool.h
@@ -88,7 +88,7 @@ extern "C"
      * mempool handler on success, NULL on error.
      * 
      */
-    extern void *wgmempool_Init(uint4 blocksize, size_t maxstrsize);
+    extern void *wgmempool_Init(size_t blocksize, size_t maxstrsize);
 
 
     /* 
commit 6e05abf180317bb8da5d585e3ad990ac69aa7ba9
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Nov 8 10:42:42 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Nov 8 10:42:42 2026 +0000

    check the allocation in prepbuffer before using it in pointer arithmetic
    
    Change-Id: Id0fd2dd936f5e317567a3f241665d2ba8ae15a9f

diff --git a/src/fingerprint.c b/src/fingerprint.c
index 899aab6..b792c43 100644
--- a/src/fingerprint.c
+++ b/src/fingerprint.c
@@ -376,13 +376,15 @@ static char *prepbuffer(const char *src, size_t bufsize, 
uint4 mindocsize)
     const char *p = src;
     const char *plimit = src + bufsize;
     char *dest = (char *)malloc(bufsize + 3);
-    char *w = dest;
-    char *wlimit = dest + bufsize + 1;
+    char *w;
+    char *wlimit;
 
     if (!dest)
     {
         return NULL;
     }
+    w = dest;
+    wlimit = dest + bufsize + 1;
 
     if (p == plimit || *p == '
     {
commit bca9fbce5a4281ccff0e16d9a4e58e1290be7016
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Nov 8 00:25:20 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Nov 8 00:25:31 2026 +0000

    rename ckb to kmr, the text is Northern Kurdish
    
    since:
    
    commit 8e488379e74a5164392aa826dd534db7f05a3261
    Date:   Fri Jun 27 10:22:32 2014 +0100
    
        add Kurdish, Central
    
    the UDHR text added as Central Kurdish is the Latin script Kurmanji
    one, efele.net has the same text as both udhr_ckb and udhr_kmr
    
    Change-Id: I03b97b7f6a145ae0bf4840dba3c7b7e5265f79e3

diff --git a/langclass/LM/ckb.lm b/langclass/LM/kmr.lm
similarity index 100%
rename from langclass/LM/ckb.lm
rename to langclass/LM/kmr.lm
diff --git a/langclass/ShortTexts/ckb.txt b/langclass/ShortTexts/kmr.txt
similarity index 100%
rename from langclass/ShortTexts/ckb.txt
rename to langclass/ShortTexts/kmr.txt
diff --git a/langclass/fpdb.conf b/langclass/fpdb.conf
index 045692f..6e14416 100644
--- a/langclass/fpdb.conf
+++ b/langclass/fpdb.conf
@@ -50,7 +50,6 @@ br.lm       br--utf8
 bs.lm       bs--utf8    #Suppress-Script: Latn
 buc.lm      buc--utf8
 ca.lm       ca--utf8
-ckb.lm      ckb--utf8
 cs.lm       cs--utf8
 cv.lm       cv--utf8
 cy.lm       cy--utf8
@@ -101,6 +100,7 @@ kbd.lm      kbd--utf8
 kk.lm       kk--utf8
 kl.lm       kl--utf8
 km.lm       km--utf8
+kmr.lm      kmr--utf8
 kn.lm       kn--utf8
 kng.lm      kng--utf8
 ko.lm       ko--utf8
diff --git a/src/Makefile.am b/src/Makefile.am
index e9ce4dc..6db8336 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,10 +36,10 @@ check:
        @echo primary languages
        @for primarylanguage in \
                ab ace ada af ak alt am ar arn ast ay az az-Cyrl ban be \
-               bem bho bi bik bg bm bn bo br bs buc ca ckb cs cv cy da \
+               bem bho bi bik bg bm bn bo br bs buc ca cs cv cy da \
                de dv dz ee el emk-Latn en eo es et eu fa fi fj fkv fo \
                fon fr frp fur fy ga gd gl grc gu gug gv ha-Latn-NG haw he hi \
-               hil hr hsb ht hu hy ia id ilo is it ja ka kaa kab kbd kk kl km 
kn \
+               hil hr hsb ht hu hy ia id ilo is it ja ka kaa kab kbd kk kl km 
kmr kn \
                kng km ko koi ktu ky la lb lg lij lld ln lo lt lv mai mfe \
                mi min mk ml mn mos mr ms mt my nb nds ne nio nl nn nr \
                nso ny oc om pa pap pl plt pt quh qul quz rm ro ru rue \

Reply via email to