File: 11-upstream-use-fputs-fputc.patch

package info (click to toggle)
httptunnel 3.3%2Bdfsg-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,500 kB
  • sloc: ansic: 4,754; makefile: 26; sh: 4
file content (46 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From: Teemu Hukkanen <tjhukkan@iki.fi>
Date: Sat, 16 Mar 2024 16:04:36 +0200
Subject: Use fputs and fputc instead of fprintf

Origin: upstream
Forwarded: not-needed
---
 ChangeLog | 5 +++++
 common.c  | 9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ac74c0..b09452a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-10  lars brinkhoff  <lars@nocrew.org>
+
+	* common.c (log_level): Where possible, use fputs and fputc
+	instead of fprintf.
+
 2001-03-30  lars brinkhoff  <lars@nocrew.org>
 
 	From Tim Phipps <Tim.Phipps@st.com>:
diff --git a/common.c b/common.c
index 3c48faa..f7103a5 100644
--- a/common.c
+++ b/common.c
@@ -38,11 +38,14 @@ log_level (int level, char *fmt0, va_list ap)
       time (&t);
       t2 = localtime (&t);
       strftime (s, sizeof s, "%Y%m%d %H%M%S ", t2);
-      fprintf (debug_file, "%s", s);
+      fputs (s, debug_file);
+
       for (i = 1; i < level; i++)
-	fprintf (debug_file, "    ");
+	fputs ("    ", debug_file);
+
       vfprintf (debug_file, fmt0, ap);
-      fprintf (debug_file, "\n");
+      fputc ('\n', debug_file);
+
       fflush (debug_file);
     }
 }