don't build strstorage and strduptab (tinyldap doesn't use it anymore)

add comments in strstorage.c and strduptab.c that they are obsolete
This commit is contained in:
leitner
2024-02-02 10:54:25 +00:00
parent a6eddb5364
commit 0cc9c5b1ec
3 changed files with 11 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#DEBUG=1
#COVERAGE=1
all: libowfat-warning t1 t2 parse dumpidx idx2ldif addindex bindrequest tinyldap \
all: libowfat-warning t2 parse dumpidx idx2ldif addindex bindrequest tinyldap \
tinyldap_standalone tinyldap_debug ldapclient ldapclient_str \
md5password mysql2ldif acl dumpacls ldapdelete asn1dump tls.a x # t6 # t
@@ -36,7 +36,7 @@ scan_ldapmessage_nolengthcheck.o
ldif.a: ldif_parse.o ldap_match_mapped.o
storage.a: strstorage.o strduptab.o mstorage_add.o mduptab_add.o \
storage.a: mstorage_add.o mduptab_add.o \
bstr_diff.o mduptab_adds.o bstr_diff2.o mstorage_add_bin.o \
mstorage_init.o mstorage_init_persistent.o mstorage_unmap.o \
mduptab_init.o mduptab_init_reuse.o mduptab_reset.o

View File

@@ -1,3 +1,6 @@
/* This is no longer used in tinyldap (see mduptab.h).
* The sources are here for historic reference. */
#include <stdlib.h>
#include <libowfat/str.h>
#include "strduptab.h"
@@ -13,9 +16,10 @@ const char* strduptab_add(struct stringduptable* t,const char* s) {
return t->s[i];
if (t->n>=t->a) {
const char** x;
int a=t->a*2;
size_t a=t->a*2; // this can not overflow
// t->s is t->a*sizeof(char*), which is always at least *2
if (!a) a=1024;
if (!(x=realloc((char**)t->s,a*sizeof(char*))))
if (!(x=reallocarray((char**)t->s,a,sizeof(char*))))
return 0;
t->a=a;
t->s=x;

View File

@@ -1,3 +1,6 @@
/* This is no longer used in tinyldap (see mstorage.h)
* The sources are here for historic reference. */
#include <stdlib.h>
#include <libowfat/byte.h>
#include "strstorage.h"