view modules/fstrcmp @ 17896:29ead46d1cca

fstrcmp: don't assume strlen < INT_MAX * lib/fstrcmp.c: Include stddef.h and stdint.h. (uintptr_t): Remove, as we're now assuming stdint. (OFFSET, EXTRA_CONTEXT_FIELDS, fstrcmp_bounded): Prefer ptrdiff_t to int when the value could exceed INT_MAX if the input string is long. (fstrcmp_bounded): Check for size-calculation overflow. Prefer uintptr_t to size_t when the underlying value is a pointer casted to an unsigned integer. Avoid unnecessary 'buffer != NULL' test. * modules/fstrcmp (Depends-on): Add stdint.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 07 Feb 2015 18:09:00 -0800
parents 1f14c6dd175d
children
line wrap: on
line source

Description:
Fuzzy string comparison.

Files:
lib/fstrcmp.h
lib/fstrcmp.c

Depends-on:
diffseq
lock
tls
minmax
stdint
xalloc

configure.ac:

Makefile.am:
lib_SOURCES += fstrcmp.h fstrcmp.c

Include:
"fstrcmp.h"

License:
GPL

Maintainer:
all