chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uaudio gains a new 'configure' method, which imposes the audio API's
[disorder]
/
lib
/
unicode.c
diff --git
a/lib/unicode.c
b/lib/unicode.c
index 3adbea0876fa8e7075622ad25b32369c47649e0d..55390eb1a52e33b4579fa4a2811003f5599d1633 100644
(file)
--- a/
lib/unicode.c
+++ b/
lib/unicode.c
@@
-1,6
+1,6
@@
/*
* This file is part of DisOrder
/*
* This file is part of DisOrder
- * Copyright (C) 2007 Richard Kettlewell
+ * Copyright (C) 2007
, 2009
Richard Kettlewell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-1358,8
+1358,10
@@
uint32_t **utf32_word_split(const uint32_t *s, size_t ns, size_t *nwp,
}
/* If it's a word add it to the list of results */
if(isword) {
}
/* If it's a word add it to the list of results */
if(isword) {
- w = xcalloc(b2 - b1 + 1, sizeof(uint32_t));
- memcpy(w, it->s + b1, (b2 - b1) * sizeof (uint32_t));
+ const size_t len = b2 - b1;
+ w = xcalloc_noptr(len + 1, sizeof(uint32_t));
+ memcpy(w, it->s + b1, len * sizeof (uint32_t));
+ w[len] = 0;
vector32_append(v32, w);
}
}
vector32_append(v32, w);
}
}