gq.patch 887 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Index: src/state.c
  2. --- src/state.c.orig 2006-04-05 02:53:55 +0200
  3. +++ src/state.c 2006-04-05 19:14:43 +0200
  4. @@ -754,7 +754,7 @@
  5. }
  6. }
  7. - if (n != NULL && v->type != 0) {
  8. + if (n != NULL && v!=NULL && v->type != 0) {
  9. char *ep;
  10. assert(v);
  11. Index: src/xmlparse.c
  12. --- src/xmlparse.c.orig 2006-04-05 02:49:19 +0200
  13. +++ src/xmlparse.c 2006-04-05 19:23:16 +0200
  14. @@ -51,7 +51,7 @@
  15. #include "xmlparse.h"
  16. #define malloc g_malloc
  17. -#define calloc(n,s) g_malloc0(n * s)
  18. +#define calloc(n,s) g_malloc0((n) * (s))
  19. #define TAGSTACK_INCR 20
  20. @@ -162,10 +162,11 @@
  21. e->attrs = NULL;
  22. if (attrs) {
  23. for (i = 0 ; attrs[i] ; i++) ;
  24. - e->attrs = calloc(i, sizeof(xmlChar *));
  25. + e->attrs = calloc(i+1, sizeof(xmlChar *));
  26. for (i = 0 ; attrs[i] ; i++) {
  27. e->attrs[i] = (guchar*)strdup((gchar*)attrs[i]);
  28. }
  29. + e->attrs[i] = NULL;
  30. }
  31. /* lookup handler */