File: initalize-return-value-in-gdbm-store.patch

package info (click to toggle)
slgdbm 1.7.1-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: ansic: 2,355; makefile: 114
file content (20 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Do not return a uninitialized value in slgdbm_store
 Assume that, when the gdbm_store function is not executed, then there
 is an error and return the value -1. According to the libgdm
 documentation, the value -1 indicates that “an error occurred which
 prevented the item from being stored in the database.”
Author: Rafael Laboissière <rafael@debian.org>
Forwarded: https://lists.jedsoft.org/lists/slang-devel/2021/0000019.html
Last-Update: 2021-12-02

--- slgdbm-1.7.1.orig/gdbm-module.c
+++ slgdbm-1.7.1/gdbm-module.c
@@ -118,7 +118,7 @@ static int slgdbm_store(char *key, char
 {
    GDBM_Type *p;
    SLang_MMT_Type *mmt;
-   int ret;
+   int ret = -1;
    datum k,v;
    k.dptr=key;
    k.dsize=strlen(key);