groff/0011-Initialize-s-to-prevent-undefined-behavior.patch

37 lines
1006 B
Diff
Raw Normal View History

From c19274b6ec048aa8c9d5e78bec22609aadf0ff4c Mon Sep 17 00:00:00 2001
From: Lukas Javorsky <ljavorsk@redhat.com>
Date: Mon, 12 Aug 2024 15:45:45 +0200
Subject: [PATCH 5/7] Initialize "s" to prevent undefined behavior
---
src/roff/troff/env.cpp | 2 +-
src/roff/troff/input.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 04eedd1..7d1c8d1 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -287,7 +287,7 @@ void leader_character()
void environment::add_char(charinfo *ci)
{
- int s;
+ int s = 0;
node *gc_np = 0;
if (interrupted)
;
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index bd586cb..4308926 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7300,7 +7300,7 @@ void check_missing_character()
int token::add_to_zero_width_node_list(node **pp)
{
hunits w;
- int s;
+ int s = 0;
node *n = 0;
switch (type) {
case TOKEN_CHAR: