summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2009-06-15 20:32:21 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:07 +0100
commit291f0bea74ac83fbb00daf1cd234c7573beb1130 (patch)
tree9a1fa898b231c40937dbc893058762a0e0a6f74a /plugin
parent8b6253640a42b6d065b2ec228bc32558be0b1c26 (diff)
downloadfribid-291f0bea74ac83fbb00daf1cd234c7573beb1130.tar.gz
fribid-291f0bea74ac83fbb00daf1cd234c7573beb1130.tar.bz2
fribid-291f0bea74ac83fbb00daf1cd234c7573beb1130.zip
Fixed a bug in the strndup code
Diffstat (limited to 'plugin')
-rw-r--r--plugin/npobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugin/npobject.c b/plugin/npobject.c
index 032c5fc..e8e9c30 100644
--- a/plugin/npobject.c
+++ b/plugin/npobject.c
@@ -41,8 +41,7 @@
static char *strndup(const char *source, int maxLength) {
int i;
for (i = 0;; i++) {
- if (i >= maxLength) { i++; break; }
- if (source[i] == '\0') break;
+ if ((i >= maxLength) || (source[i] == '\0')) break;
}
char *ret = malloc(i+1);