aboutsummaryrefslogtreecommitdiff
path: root/pcre.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcre.c')
-rw-r--r--pcre.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pcre.c b/pcre.c
index a17a08e..5630ac7 100644
--- a/pcre.c
+++ b/pcre.c
@@ -28,7 +28,7 @@ int plugin_is_GPL_compatible;
const int MAX_CAP = 256; /* maximum number of substrings to capture */
const int MAX_CAP_LEN = 3; /* number of decimal digits in MAX_CAP */
-const int MAX_MSG_LEN = 1023; /* max length of error/warning/info message */
+const int MAX_MSG_LEN = 1024; /* max length of error/warning/info message */
/* esc_str() - escape string before assigning it to make variable */
char *esc_str(const char *str)
@@ -63,8 +63,8 @@ int mk_error(const char *fmt, ...)
va_start(args, fmt);
- msg = gmk_alloc(MAX_MSG_LEN+1);
- vsprintf(msg, fmt, args);
+ msg = gmk_alloc(MAX_MSG_LEN);
+ vsnprintf(msg, MAX_MSG_LEN, fmt, args);
emsg = esc_str(msg);
gmk_free(msg);
mk = gmk_alloc(strlen(emsg) + 10);
@@ -82,8 +82,8 @@ int mk_warning(const char *fmt, ...)
va_start(args, fmt);
- msg = gmk_alloc(MAX_MSG_LEN+1);
- vsprintf(msg, fmt, args);
+ msg = gmk_alloc(MAX_MSG_LEN);
+ vsnprintf(msg, MAX_MSG_LEN, fmt, args);
emsg = esc_str(msg);
gmk_free(msg);
mk = gmk_alloc(strlen(emsg) + 12);
@@ -101,8 +101,8 @@ int mk_info(const char *fmt, ...)
va_start(args, fmt);
- msg = gmk_alloc(MAX_MSG_LEN+1);
- vsprintf(msg, fmt, args);
+ msg = gmk_alloc(MAX_MSG_LEN);
+ vsnprintf(msg, MAX_MSG_LEN, fmt, args);
emsg = esc_str(msg);
gmk_free(msg);
mk = gmk_alloc(strlen(emsg) + 9);