Repositories
/
olsrd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6b289b
)
common: make an exit condition in strscat more readable
author
Ferry Huberts
<ferry.huberts@pelagic.nl>
Thu, 2 Jun 2016 19:56:04 +0000
(21:56 +0200)
committer
Ferry Huberts
<ferry.huberts@pelagic.nl>
Thu, 2 Jun 2016 20:05:46 +0000
(22:05 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/common/string_handling.c
patch
|
blob
|
history
diff --git
a/src/common/string_handling.c
b/src/common/string_handling.c
index
0d4e857
..
42fa804
100644
(file)
--- a/
src/common/string_handling.c
+++ b/
src/common/string_handling.c
@@
-142,7
+142,7
@@
char * strscat(char *dest, const char *src, size_t dest_size) {
}
dst_content_len = strlen(dest);
- if (
dest_size <= dst_content_len
) {
+ if (
(dest_size - dst_content_len) <= 0
) {
return dest;
}
return _internal_strscpy(dest + dst_content_len, src, dest_size - dst_content_len);