Browse code

Changed freshclam help string to use printf instead of mprintf because the libfreshclam mprintf_stdout global variable cannot be changed directly in freshclam on Windows.

Micah Snyder authored on 2019/05/29 04:01:21
Showing 1 changed files
... ...
@@ -136,44 +136,42 @@ static void writepid(const char *pidfile)
136 136
 
137 137
 static void help(void)
138 138
 {
139
-    mprintf_stdout = 1;
140
-
141
-    mprintf("\n");
142
-    mprintf("                      Clam AntiVirus: Database Updater %s\n", get_version());
143
-    mprintf("           By The ClamAV Team: https://www.clamav.net/about.html#credits\n");
144
-    mprintf("           (C) 2019 Cisco Systems, Inc.\n");
145
-    mprintf("\n");
146
-    mprintf("    freshclam [options]\n");
147
-    mprintf("\n");
148
-    mprintf("    --help               -h              Show this help\n");
149
-    mprintf("    --version            -V              Print version number and exit\n");
150
-    mprintf("    --verbose            -v              Be verbose\n");
151
-    mprintf("    --debug                              Enable debug messages\n");
152
-    mprintf("    --quiet                              Only output error messages\n");
153
-    mprintf("    --no-warnings                        Don't print and log warnings\n");
154
-    mprintf("    --stdout                             Write to stdout instead of stderr. Does not affect 'debug' messages.\n");
155
-    mprintf("    --show-progress                      Show download progress percentage\n");
156
-    mprintf("\n");
157
-    mprintf("    --config-file=FILE                   Read configuration from FILE.\n");
158
-    mprintf("    --log=FILE           -l FILE         Log into FILE\n");
159
-    mprintf("    --daemon             -d              Run in daemon mode\n");
160
-    mprintf("    --pid=FILE           -p FILE         Save daemon's pid in FILE\n");
139
+    printf("\n");
140
+    printf("                      Clam AntiVirus: Database Updater %s\n", get_version());
141
+    printf("           By The ClamAV Team: https://www.clamav.net/about.html#credits\n");
142
+    printf("           (C) 2019 Cisco Systems, Inc.\n");
143
+    printf("\n");
144
+    printf("    freshclam [options]\n");
145
+    printf("\n");
146
+    printf("    --help               -h              Show this help\n");
147
+    printf("    --version            -V              Print version number and exit\n");
148
+    printf("    --verbose            -v              Be verbose\n");
149
+    printf("    --debug                              Enable debug messages\n");
150
+    printf("    --quiet                              Only output error messages\n");
151
+    printf("    --no-warnings                        Don't print and log warnings\n");
152
+    printf("    --stdout                             Write to stdout instead of stderr. Does not affect 'debug' messages.\n");
153
+    printf("    --show-progress                      Show download progress percentage\n");
154
+    printf("\n");
155
+    printf("    --config-file=FILE                   Read configuration from FILE.\n");
156
+    printf("    --log=FILE           -l FILE         Log into FILE\n");
157
+    printf("    --daemon             -d              Run in daemon mode\n");
158
+    printf("    --pid=FILE           -p FILE         Save daemon's pid in FILE\n");
161 159
 #ifndef _WIN32
162
-    mprintf("    --user=USER          -u USER         Run as USER\n");
160
+    printf("    --user=USER          -u USER         Run as USER\n");
163 161
 #endif
164
-    mprintf("    --no-dns                             Force old non-DNS verification method\n");
165
-    mprintf("    --checks=#n          -c #n           Number of checks per day, 1 <= n <= 50\n");
166
-    mprintf("    --datadir=DIRECTORY                  Download new databases into DIRECTORY\n");
162
+    printf("    --no-dns                             Force old non-DNS verification method\n");
163
+    printf("    --checks=#n          -c #n           Number of checks per day, 1 <= n <= 50\n");
164
+    printf("    --datadir=DIRECTORY                  Download new databases into DIRECTORY\n");
167 165
 #ifdef BUILD_CLAMD
168
-    mprintf("    --daemon-notify[=/path/clamd.conf]   Send RELOAD command to clamd\n");
166
+    printf("    --daemon-notify[=/path/clamd.conf]   Send RELOAD command to clamd\n");
169 167
 #endif
170
-    mprintf("    --local-address=IP   -a IP           Bind to IP for HTTP downloads\n");
171
-    mprintf("    --on-update-execute=COMMAND          Execute COMMAND after successful update\n");
172
-    mprintf("    --on-error-execute=COMMAND           Execute COMMAND if errors occurred\n");
173
-    mprintf("    --on-outdated-execute=COMMAND        Execute COMMAND when software is outdated\n");
174
-    mprintf("    --list-mirrors                       (deprecated) Print mirrors from mirrors.dat\n");
175
-    mprintf("    --update-db=DBNAME                   Only update database DBNAME\n");
176
-    mprintf("\n");
168
+    printf("    --local-address=IP   -a IP           Bind to IP for HTTP downloads\n");
169
+    printf("    --on-update-execute=COMMAND          Execute COMMAND after successful update\n");
170
+    printf("    --on-error-execute=COMMAND           Execute COMMAND if errors occurred\n");
171
+    printf("    --on-outdated-execute=COMMAND        Execute COMMAND when software is outdated\n");
172
+    printf("    --list-mirrors                       (deprecated) Print mirrors from mirrors.dat\n");
173
+    printf("    --update-db=DBNAME                   Only update database DBNAME\n");
174
+    printf("\n");
177 175
 }
178 176
 
179 177
 static void libclamav_msg_callback(enum cl_msg severity, const char *fullmsg, const char *msg, void *ctx)