瀏覽代碼

libdpkg: Use MAX_CONFIG_LINE instead of MAXDIVERTFILENAME in myfileopt

Guillem Jover 17 年之前
父節點
當前提交
6c0c8c0508
共有 3 個文件被更改,包括 9 次插入1 次删除
  1. 6 0
      ChangeLog
  2. 1 1
      lib/myopt.c
  3. 2 0
      lib/myopt.h

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-01-04  Guillem Jover  <guillem@debian.org>
+
+	* lib/myopt.h (MAX_CONFIG_LINE): New macro.
+	* lib/myopt.c (myfileopt): Use MAX_CONFIG_LINE instead of
+	MAXDIVERTFILENAME.
+
 2009-01-04  Guillem Jover  <guillem@debian.org>
 
 	* lib/dpkg.h (SHELL, SHELLENVIR): Remove unused macros.

+ 1 - 1
lib/myopt.c

@@ -48,7 +48,7 @@ badusage(const char *fmt, ...)
 
 void myfileopt(const char* fn, const struct cmdinfo* cmdinfos) {
   FILE* file;
-  char linebuf[MAXDIVERTFILENAME];
+  char linebuf[MAX_CONFIG_LINE];
 
   file= fopen(fn, "r");
   if (!file) {

+ 2 - 0
lib/myopt.h

@@ -42,6 +42,8 @@ struct cmdinfo {
 
 void badusage(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
 
+#define MAX_CONFIG_LINE 1024
+
 void myfileopt(const char* fn, const struct cmdinfo* cmdinfos);
 void myopt(const char *const **argvp, const struct cmdinfo *cmdinfos);
 void loadcfgfile(const char *prog, const struct cmdinfo *cmdinfos);