diff libfdproto/ostr.c @ 730:e21d79595045

minor improvements
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 24 Feb 2011 17:19:42 +0900
parents dc71992e3378
children d666051658bd
line wrap: on
line diff
--- a/libfdproto/ostr.c	Thu Feb 24 17:19:14 2011 +0900
+++ b/libfdproto/ostr.c	Thu Feb 24 17:19:42 2011 +0900
@@ -40,11 +40,12 @@
 #include <idna.h> /* idna_to_ascii_8z() */
 #endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */
 
-/* Similar to strdup with (must be verified) os0_t */
+/* Similar to strdup with (must have been verified) os0_t */
 os0_t os0dup_int(os0_t s, size_t l) {
 	os0_t r;
-	CHECK_MALLOC_DO( r = calloc(l+1, 1), return NULL );
+	CHECK_MALLOC_DO( r = malloc(l+1), return NULL );
 	memcpy(r, s, l); /* this might be faster than a strcpy or strdup because it can work with 32 or 64b blocks */
+	r[l] = '\0';
 	return r;
 }
 
"Welcome to our mercurial repository"