summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn ffitch <jpff@codemist.co.uk>2018-12-11 17:13:54 +0000
committerSam Hartman <hartmans@debian.org>2019-03-21 10:31:29 -0400
commitd4ff8771a25298faa557cfecad9dce7b241d185d (patch)
tree7e3f0e700e1a9eb7628b966a03dbab841549ea02
parent20642307a286a27324463879a55f2c746aefd824 (diff)
finish botched edit in zak.c
Gbp-Pq: Name finish-botched-edit-in-zak.c.patch
-rw-r--r--InOut/widgets.cpp6
-rw-r--r--Opcodes/zak.c21
2 files changed, 19 insertions, 8 deletions
diff --git a/InOut/widgets.cpp b/InOut/widgets.cpp
index c50be84c..ca0ab0ae 100644
--- a/InOut/widgets.cpp
+++ b/InOut/widgets.cpp
@@ -3240,7 +3240,7 @@ extern "C" {
{
//char *text = p->itext->data;
Fl_Box *o = new Fl_Box((int)*p->ix, (int)*p->iy,
- (int)*p->iwidth, (int)*p->iheight, text);
+ (int)*p->iwidth, (int)*p->iheight, strdup(text));
widget_attributes(csound, o);
Fl_Boxtype type;
int itype = (int) *p->itype;
@@ -3324,6 +3324,7 @@ extern "C" {
char *text = p->itext->data;
ADDR_SET_VALUE v = widgetGlobals->AddrSetValue[(int) *p->ihandle];
Fl_Widget *o = (Fl_Widget *) v.WidgAddress;
+ free((void*)o->label());
o->label(text);
return OK;
}
@@ -3338,7 +3339,8 @@ extern "C" {
Fl_Widget *o = (Fl_Widget *) v.WidgAddress;
if (i<0 || i>csound->GetStrsmax(csound)) text = (char *) "???";
else if ((text=csound->GetStrsets(csound,i))==NULL) text = (char *) "???";
- o->label(text);
+ free((void*)o->label());
+ o->label(strdup(text));
return OK;
}
diff --git a/Opcodes/zak.c b/Opcodes/zak.c
index ae3619ec..de10b99e 100644
--- a/Opcodes/zak.c
+++ b/Opcodes/zak.c
@@ -177,10 +177,15 @@ int32_t zir(CSOUND *csound, ZKR *p)
{
/* See zkr() for more comments. */
int32_t indx;
- ZAK_GLOBALS* zak = (ZAK_GLOBALS*) p->zz;
+ ZAK_GLOBALS* zak;
- if (UNLIKELY(zak == NULL))
- return NOTOK;
+ if (UNLIKELY(zkset(csound, (ZKR*)p)!=OK))
+ return csound->InitError(csound, Str("No zk space: "
+ "zakinit has not been called yet."));
+ zak = (ZAK_GLOBALS*) p->zz;
+
+ /* if (UNLIKELY(zak == NULL)) */
+ /* return NOTOK; */
/* Check to see this index is within the limits of zk space. */
indx = (int32_t) *p->ndx;
if (UNLIKELY(indx > zak->zklast)) {
@@ -236,10 +241,14 @@ int32_t zkw(CSOUND *csound, ZKW *p)
int32_t ziw(CSOUND *csound, ZKW *p)
{
int32_t indx;
- ZAK_GLOBALS* zak = (ZAK_GLOBALS*) p->zz;
+ ZAK_GLOBALS* zak;
- if (UNLIKELY(zak==NULL))
- return NOTOK;
+ if (UNLIKELY(zkset(csound, (ZKR*)p)!= OK))
+ return csound->InitError(csound, Str("No zk space: "
+ "zakinit has not been called yet."));
+ zak = p->zz;
+ /* if (UNLIKELY(zak==NULL)) */
+ /* return NOTOK; */
indx = (int32_t) *p->ndx;
if (UNLIKELY(indx > zak->zklast)) {
return csound->InitError(csound, Str("ziw index > isizek. Not writing."));