Hi Andrew,
in glpmpl01.c, print_context defines c as int. c should be char because
mpl->context is *char.
memmove will copy only CONTEXT_SIZE-1 bytes even if char is 2 bytes wide on
unicode systems. strncpy might be as better choice. Otherwise You might use
memmove with (CONTEXT_SIZE-1) * sizeof(char).
Best regards
Xypron
/*----------------------------------------------------------------------
-- print_context - print current content of context queue.
--
-- This routine prints current content of the context queue. */
void print_context(MPL *mpl)
{ int c;
while (mpl->c_ptr > 0)
{ mpl->c_ptr--;
c = mpl->context[0];
memmove(mpl->context, mpl->context+1, CONTEXT_SIZE-1);
mpl->context[CONTEXT_SIZE-1] = (char)c;
}
print("Context: %s%.*s", mpl->context[0] == ' ' ? "" : "...",
CONTEXT_SIZE, mpl->context);
return;
}
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk