File sc-fix-uninitialized-variables.patch of Package sc
Index: sc-7.16/abbrev.c
===================================================================
--- sc-7.16.orig/abbrev.c
+++ sc-7.16/abbrev.c
@@ -124,9 +124,9 @@ void
del_abbr(char *abbrev)
{
struct abbrev *a;
- struct abbrev **prev;
+ struct abbrev *prev = NULL;
- if (!(a = find_abbr(abbrev, strlen(abbrev), prev)))
+ if (!(a = find_abbr(abbrev, strlen(abbrev), &prev)))
return;
if (a->a_next)
Index: sc-7.16/cmds.c
===================================================================
--- sc-7.16.orig/cmds.c
+++ sc-7.16/cmds.c
@@ -478,7 +478,7 @@ yankrow(int arg)
int i, qtmp;
char buf[50];
struct frange *fr;
- struct ent *obuf;
+ struct ent *obuf = NULL;
if ((fr = find_frange(currow, curcol)))
rs = fr->or_right->row - currow + 1;
@@ -535,7 +535,7 @@ yankcol(int arg)
int cs = maxcol - curcol + 1;
int i, qtmp;
char buf[50];
- struct ent *obuf;
+ struct ent *obuf = NULL;
if (cs - arg < 0) {
cs = cs > 0 ? cs : 0;
@@ -2279,7 +2279,7 @@ copye(register struct enode *e, int Rdel
ret->e.r.right.vp = lookat(newrow, newcol);
ret->e.r.right.vf = e->e.r.right.vf;
} else {
- struct enode *temprange;
+ struct enode *temprange = NULL;
if (freeenodes) {
ret = freeenodes;
Index: sc-7.16/lex.c
===================================================================
--- sc-7.16.orig/lex.c
+++ sc-7.16/lex.c
@@ -109,7 +109,7 @@ int
yylex()
{
char *p = line + linelim;
- int ret;
+ int ret = -1;
static int isfunc = 0;
static bool isgoto = 0;
static bool colstate = 0;
Index: sc-7.16/screen.c
===================================================================
--- sc-7.16.orig/screen.c
+++ sc-7.16/screen.c
@@ -812,7 +812,7 @@ update(int anychanged) /* did any cell
for (i = 0; i < fwidth[col]; i++) {
if (note) {
attr_t attr;
- short curcolor;
+ short curcolor = 0;
if (!i && color && has_colors()) {
attr_get(&attr, &curcolor, NULL);
color_set(4, NULL);
@@ -832,7 +832,7 @@ update(int anychanged) /* did any cell
(void)addch(' ');
if (note) {
attr_t attr;
- short curcolor;
+ short curcolor = 0;
if (color && has_colors()) {
attr_get(&attr, &curcolor, NULL);
color_set(4, NULL);