emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob fd9a193e763bc9d00eb0a905d30f38570a17078f 671 bytes (raw)
name: gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
From bc9e5f03d71b3dd4360721f4df3524c1dcba9bc8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:00:53 +0100
Subject: [PATCH] Fix format truncation for GCC >7.1.


diff --git a/main.cpp b/main.cpp
index 72bd94b..800db0b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1490,7 +1490,7 @@ static bool saveEntry(FILE* outFile, char* path, rk_entry_type type,
 static inline uint32_t convertChipType(const char* chip) {
 	char buffer[5];
 	memset(buffer, 0, sizeof(buffer));
-	snprintf(buffer, sizeof(buffer), "%s", chip);
+	memcpy(buffer, chip, 4);
 	return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
 }
 
-- 
2.34.0


debug log:

solving fd9a193e76 ...
found fd9a193e76 in https://list.orgmode.org/orgmode/UbNDhFyAp_6UmSgTIicxl617-LOqZ-hj1TQSPO8a4XbarG2T8MqZwrEguOHeQ-YanQ30pDM_zxd90BpOzMgg8anTh-P-VqSwpRX2DG1HEUM=@protonmail.com/

applying [1/1] https://list.orgmode.org/orgmode/UbNDhFyAp_6UmSgTIicxl617-LOqZ-hj1TQSPO8a4XbarG2T8MqZwrEguOHeQ-YanQ30pDM_zxd90BpOzMgg8anTh-P-VqSwpRX2DG1HEUM=@protonmail.com/
diff --git a/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
new file mode 100644
index 0000000000..fd9a193e76

1:19: space before tab in indent.
 	char buffer[5];
1:20: space before tab in indent.
 	memset(buffer, 0, sizeof(buffer));
1:23: space before tab in indent.
 	return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
1:25: trailing whitespace.
 
1:26: trailing whitespace.
-- 
Checking patch gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch...
Applied patch gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 fd9a193e763bc9d00eb0a905d30f38570a17078f	gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).