File: fix-printf_incorrect_specifiers.patch

package info (click to toggle)
w3cam 0.7.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 748 kB
  • sloc: ansic: 3,822; makefile: 70
file content (34 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download
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
Author: Tj <debian@iam.tj>
Last-Update: 2025-10-28
Forwarded: no
Description: Fix printf incorrect specifiers

--- a/w3camd/w3camd.c
+++ b/w3camd/w3camd.c
@@ -186,7 +186,7 @@ WAIT:
 		} else {
 			img->state = ST_BUSY;
 			pthread_mutex_lock (&img->img_lock);
-			printf ("0x%X 0x%X %dx%d\n", img, vid->mem,vid->width, vid->height);
+			printf ("0x%p 0x%p %dx%d\n", img, vid->mem,vid->width, vid->height);
 			memcpy (img->img, vid->mem, vid->width * vid->height * 3);
 			printf ("done ..\n");
 #ifdef DEBUG
@@ -214,7 +214,7 @@ e_help (conn_t *cn)
 		"  /image[?quality=<#>[&stream]] - retrieve an image\n"
 		"  /help                - see these lines\n";
 
-	sprintf (buf, "%d", strlen (e));
+	sprintf (buf, "%zd", strlen (e));
 	http_status (cn->fd, HTTP_OK);
 	http_header (cn->fd, HTTP_SERVER, SERVER_NAME);
 	http_header (cn->fd, HTTP_CONTENT_TYPE, "text/plain");
@@ -231,7 +231,7 @@ e_wrong_url (conn_t *cn)
 	char buf[16];
 	char *e = "wrong url!\n  try \"/help\"\n";
 
-	sprintf (buf, "%d", strlen (e));
+	sprintf (buf, "%zd", strlen (e));
 	http_status (cn->fd, HTTP_BAD_REQUEST);
 	http_header (cn->fd, HTTP_SERVER, SERVER_NAME);
 	http_header (cn->fd, HTTP_CONTENT_TYPE, "text/plain");