[DGD][BUG] Null bytes are not ignored properly.

Marc Spoorendonk marc at freud.et.tudelft.nl
Fri May 28 18:56:46 CEST 1999


Hi,

As far as I know null bytes are not used to terminate strings in DGD.
Since I am using binary strings now, I encountered some bugs. (I run
V1.1.49 and I didn't bother to check the last version of dgd.)

I think that there are more bugs regarding this subject but this is one of
them. (I'll mail the rest to you later when I localized them.)

FIX:

*** compile.c.bak       Thu May 27 10:45:43 1999
--- compile.c   Thu May 27 10:55:37 1999
*************** node *expr, *stmt;
*** 1246,1251 ****
                    i = (v[0]->l.left->type == N_INT);
                    for (w = v + i, i = size - i - 1; i > 0; w++, --i) {
!                       if (strcmp(w[0]->l.left->l.string->text,
!                                  w[1]->l.left->l.string->text) == 0) {
                            c_error("duplicate case labels in switch");
                            break;
--- 1246,1254 ----
                    i = (v[0]->l.left->type == N_INT);
                    for (w = v + i, i = size - i - 1; i > 0; w++, --i) {
!                       string *str0, *str1;
!                       str0=w[0]->l.left->l.string;
!                       str1=w[1]->l.left->l.string;
!                       if(str0->len==str1->len &&
!                               memcmp(str0->text, str1->text, str0->len)==0) {
                            c_error("duplicate case labels in switch");
                            break;

--
Marc Spoorendonk
Department of Electrical Engineering
Delft University of Technology

e-mail			: Marc at freud.et.tudelft.nl
mud			: telnet://freud.et.tudelft.nl:8888
URL			: http://freud.et.tudelft.nl/~marc/index.html


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list