aboutsummaryrefslogtreecommitdiff
path: root/src/cubeit.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-09-18 17:09:45 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:58 +0100
commite893ef14d77ff4a16151ee8c8807a156d4b657b8 (patch)
tree121145ba5dfb4c0b6e2cb1130d752018c3d6f9d4 /src/cubeit.c
parent8b64510731343321ba3ce00199ea80fb7266c8db (diff)
cubeit: More bugs
Diffstat (limited to 'src/cubeit.c')
-rw-r--r--src/cubeit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cubeit.c b/src/cubeit.c
index a63b7e6e..e82bbb8e 100644
--- a/src/cubeit.c
+++ b/src/cubeit.c
@@ -343,7 +343,7 @@ static void write_slice(const char *filename, double *vals, int z,
PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
- row_pointers = malloc(h*sizeof(png_bytep *));
+ row_pointers = malloc(ph*sizeof(png_bytep *));
/* Write the image data */
max /= boost;
@@ -468,7 +468,7 @@ int main(int argc, char *argv[])
char *infile = NULL;
char *geomfile = NULL;
FILE *fh;
- char *rval = NULL;
+ int rval;
int n_images;
char *prefix = NULL;
int nthreads = 1;
@@ -637,12 +637,12 @@ int main(int argc, char *argv[])
do {
int i;
+ rval = 0;
for ( i=0; i<nthreads; i++ ) {
struct process_args *pargs;
int done;
- int rval;
char *filename;
UnitCell *cell;
@@ -685,7 +685,7 @@ int main(int argc, char *argv[])
}
- } while ( rval != NULL );
+ } while ( rval == 0 );
/* Join threads */
for ( i=0; i<nthreads; i++ ) {