File: patch

package info (click to toggle)
mc 4.5.1-1.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,096 kB
  • ctags: 11,073
  • sloc: ansic: 89,604; tcl: 1,779; makefile: 1,267; sh: 869; perl: 289; awk: 148; sed: 93; csh: 1
file content (28 lines) | stat: -rw-r--r-- 737 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
--- slang/sltermin.c    Mon Oct 12 03:31:03 1998
+++ slang/sltermin.c.new        Sat Feb 13 17:31:30 1999
@@ -235,7 +235,7 @@
    char *tidir; 
    int i;
    FILE *fp = NULL;
-   char file[256];
+   char *file;
    Terminfo_Type *ti;
 
    if (
@@ -269,8 +269,14 @@
        tidir = Terminfo_Dirs[i];
        if (tidir != NULL)
          {
+            file = SLMALLOC (strlen (tidir) + 3 + strlen (term) + 1);
+            if (!file)
+               continue;
             sprintf (file, "%s/%c/%s", tidir, *term, term);
-            if (NULL != (fp = open_terminfo (file, ti))) break;
+            fp = open_terminfo (file, ti);
+            SLFREE (file);
+            if (fp)
+               break;
          }
        i++;
      }