Changeset: c9bd8da51ba1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9bd8da51ba1
Modified Files:
gdk/gdk_utils.c
Branch: default
Log Message:
Add GDKstrndup for static analysis.
diffs (21 lines):
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -1855,6 +1855,17 @@ GDKstrdup(const char *s)
return p;
}
+char *
+GDKstrndup(const char *s, size_t size)
+{
+ char *p = malloc(size + 1);
+ if (p == NULL)
+ GDKerror("GDKstrdup failed for %s\n", s);
+ memcpy(p, s, size);
+ p[size] = 0;
+ return p;
+}
+
#endif /* STATIC_CODE_ANALYSIS */
void
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list