diff --git a/src/lib3270/html.c b/src/lib3270/html.c
index 6986d82..b0693fe 100644
--- a/src/lib3270/html.c
+++ b/src/lib3270/html.c
@@ -99,6 +99,7 @@
struct html_info
{
int szText;
+ int form;
enum mode
{
@@ -182,6 +183,8 @@
{
char name[30];
+ info->form = 1;
+
snprintf(name,29,"F%04d",addr);
append_string(info,"";
+ static const char * suffix = "";
+ char *text = info.text;
+
+ info.text = lib3270_malloc(strlen(prefix)+strlen(suffix)+strlen(text)+4);
+
+ strcpy(info.text,prefix);
+ strcat(info.text,text);
+ strcat(info.text,suffix);
+
+ lib3270_free(text);
+ }
+
return lib3270_realloc(info.text,strlen(info.text)+2);
}
diff --git a/src/lib3270/util.c b/src/lib3270/util.c
index b0ffdf4..f992cac 100644
--- a/src/lib3270/util.c
+++ b/src/lib3270/util.c
@@ -179,7 +179,7 @@ char * lib3270_vsprintf(const char *fmt, va_list args)
char buf[16384];
int nc;
- nc = vsprintf(buf, fmt, args);
+ nc = vsnprintf(buf, sizeof(buf), fmt, args);
if (nc > sizeof(buf))
Error(NULL,"Internal buffer overflow");
r = lib3270_malloc(nc + 1);
--
libgit2 0.21.2