projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strndup_chk関数とユニットテストを追加
[YACASL2.git]
/
include
/
cmem.h
diff --git
a/include/cmem.h
b/include/cmem.h
index
132ef28
..
fca5acb
100644
(file)
--- a/
include/cmem.h
+++ b/
include/cmem.h
@@
-56,4
+56,14
@@
void *calloc_chk(size_t nmemb, size_t size, char *tag);
*/
char *strdup_chk(const char *s, char *tag);
*/
char *strdup_chk(const char *s, char *tag);
+/**
+ * @brief malloc_chkを実行してメモリを確保し、コピーした文字列の指定した長さの部分を返す
+ *
+ * @return コピーした文字列
+ *
+ * @param s 文字列
+ * @param len 文字列の長さ
+ * @param tag エラーメッセージなどで表示されるタグ
+ */
+char *strndup_chk(const char *s, size_t len, char *tag);
#endif
#endif