summaryrefslogtreecommitdiff
path: root/Lib/ocaml
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/ocaml')
-rw-r--r--Lib/ocaml/cstring.i10
-rw-r--r--Lib/ocaml/typecheck.i2
2 files changed, 6 insertions, 6 deletions
diff --git a/Lib/ocaml/cstring.i b/Lib/ocaml/cstring.i
index f1190ad5c..8b72be9d0 100644
--- a/Lib/ocaml/cstring.i
+++ b/Lib/ocaml/cstring.i
@@ -25,7 +25,7 @@
*
* %cstring_bounded_output(char *outx, 512);
* void foo(char *outx) {
- * sprintf(outx,"blah blah\n");
+ * strcpy(outx,"blah blah\n");
* }
*
*/
@@ -144,7 +144,7 @@
*
* %cstring_output_maxsize(char *outx, int max) {
* void foo(char *outx, int max) {
- * sprintf(outx,"blah blah\n");
+ * strcpy(outx,"blah blah\n");
* }
*/
@@ -175,7 +175,7 @@
*
* %cstring_output_maxsize(char *outx, int *max) {
* void foo(char *outx, int *max) {
- * sprintf(outx,"blah blah\n");
+ * strcpy(outx,"blah blah\n");
* *max = strlen(outx);
* }
*/
@@ -213,7 +213,7 @@
* %cstring_output_allocated(char **outx, free($1));
* void foo(char **outx) {
* *outx = (char *) malloc(512);
- * sprintf(outx,"blah blah\n");
+ * strcpy(outx,"blah blah\n");
* }
*/
@@ -241,7 +241,7 @@
* %cstring_output_allocated(char **outx, int *sz, free($1));
* void foo(char **outx, int *sz) {
* *outx = (char *) malloc(512);
- * sprintf(outx,"blah blah\n");
+ * strcpy(outx,"blah blah\n");
* *sz = strlen(outx);
* }
*/
diff --git a/Lib/ocaml/typecheck.i b/Lib/ocaml/typecheck.i
index 0c0a600a0..238f90d8d 100644
--- a/Lib/ocaml/typecheck.i
+++ b/Lib/ocaml/typecheck.i
@@ -183,7 +183,7 @@
unsigned long,
unsigned short {
char error_msg[256];
- sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1);
+ SWIG_snprintf(error_msg, sizeof(error_msg), "C++ $1_type exception thrown, value: %d", $1);
SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg);
}