Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 15 Dec 2012 01:51:07 +0100
From: magnum <>
To: "" <>
Subject: Use of strnlen()

While implementing --min-len (experimental, but committed) in wordlist.c I thought strnlen should be a lot quicker than strlen in many use cases. But I get this:

wordlist.c: In function ‘dummy_rules_apply’:
wordlist.c:211: warning: implicit declaration of function ‘strnlen’

This happens under OSX as well as Linux. The man page for OSX just says I should include string.h, which we do. The man page for Linux also mentions feature macros, which I have never really understood. I tried "#define _XOPEN_SOURCE 700" right before including string.h but it made no difference.

Despite the warning, it works fine - but something is not right. What do I need to do? And this seem to be a late extension... is there any way I could conditionally use strnlen and fallback to strlen?


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ