Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/alpm.c4
-rw-r--r--lib/libalpm/log.c4
-rw-r--r--lib/libalpm/log.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 145996fe..9dc6556b 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -529,11 +529,11 @@ int alpm_trans_release()
int alpm_logaction(char *fmt, ...)
{
- char str[256];
+ char str[LOG_STR_LEN];
va_list args;
va_start(args, fmt);
- vsnprintf(str, 256, fmt, args);
+ vsnprintf(str, LOG_STR_LEN, fmt, args);
va_end(args);
return(_alpm_log_action(handle->usesyslog, handle->logfd, str));
diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c
index dd4d34a0..cf5a9b48 100644
--- a/lib/libalpm/log.c
+++ b/lib/libalpm/log.c
@@ -33,7 +33,7 @@ unsigned char __pm_logmask = 0;
void _alpm_log(unsigned char flag, char *fmt, ...)
{
- char str[256];
+ char str[LOG_STR_LEN];
va_list args;
if(__pm_logcb == NULL) {
@@ -42,7 +42,7 @@ void _alpm_log(unsigned char flag, char *fmt, ...)
if(flag & __pm_logmask) {
va_start(args, fmt);
- vsnprintf(str, 256, fmt, args);
+ vsnprintf(str, LOG_STR_LEN, fmt, args);
va_end(args);
__pm_logcb(flag, str);
diff --git a/lib/libalpm/log.h b/lib/libalpm/log.h
index 852202ab..e9a9a4f9 100644
--- a/lib/libalpm/log.h
+++ b/lib/libalpm/log.h
@@ -21,6 +21,8 @@
#ifndef _ALPM_LOG_H
#define _ALPM_LOG_H
+#define LOG_STR_LEN 256
+
typedef void (*alpm_cb_log)(unsigned short, char *);
void _alpm_log(unsigned char flag, char *fmt, ...);