projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7a166a1
)
Add an assertion (n > 0) in strNcpy(), it may help to catch incorrect
author
nbk
<nbk>
Mon, 22 Aug 2005 16:52:52 +0000
(16:52 +0000)
committer
nbk
<nbk>
Mon, 22 Aug 2005 16:52:52 +0000
(16:52 +0000)
use of the function.
src/lib/misc.c
patch
|
blob
|
history
diff --git
a/src/lib/misc.c
b/src/lib/misc.c
index
93d83f0
..
50cb091
100644
(file)
--- a/
src/lib/misc.c
+++ b/
src/lib/misc.c
@@
-41,6
+41,7
@@
static const char rcsid[] =
#include "missing.h"
#include "libradius.h"
+#include "rad_assert.h"
int librad_dodns = 0;
int librad_debug = 0;
@@
-186,6
+187,8
@@
char *strNcpy(char *dest, const char *src, int n)
{
char *p = dest;
+ rad_assert(n > 0);
+
while ((n > 1) && (*src)) {
*(p++) = *(src++);