diff Meerwald/coord.c @ 8:f83ef905a63d

fixing many warnings increase capacity for coordinates in bruyn fix some uninit. variables
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Tue, 22 Apr 2008 13:36:05 +0200
parents be303a3f5ea8
children
line wrap: on
line diff
--- a/Meerwald/coord.c	Wed Apr 16 15:55:52 2008 +0200
+++ b/Meerwald/coord.c	Tue Apr 22 13:36:05 2008 +0200
@@ -5,7 +5,7 @@
 struct coords *alloc_coords(int n) {
   struct coords *c;
 
-  if (c = malloc(sizeof(struct coords)))
+  if ((c = malloc(sizeof(struct coords))) != NULL)
     init_coords(c, n);
 #ifdef DEBUG
   else
@@ -39,7 +39,7 @@
   c->count = 0;
   c->max = n;
 
-  if (c->values = malloc(n * sizeof(struct coord)))
+  if ((c->values = malloc(n * sizeof(struct coord))) != NULL)
     return 0;
   else
     return -1;

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.