*
* Copyright (C) 2005 Mike Baker
*
- * $Id$
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * $Id$
+ *
*/
#include <stdio.h>
unsigned long crc;
unsigned long poly = 0xEDB88320L;
int n, bit;
- crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long));
+ if ((crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long))) == (void *)-1) {
+ perror("malloc");
+ exit(1);
+ }
for (n = 0; n < 256; n++) {
crc = (unsigned long) n;
for (bit = 0; bit < 8; bit++)
if (argc > 1 && !strcmp(argv[1],"--move")) {
if (ptr->offsets[1] >= ptr->len) {
printf("Partition already moved outside trx\n");
+#if 0
} else if (ptr->offsets[1] & 0x0001ffff) {
printf("Partition does not start on a block boundary\n");
+#endif
} else {
init_crc32();
- bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len));
+ //bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len));
ptr->len = ptr->offsets[1];
ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
msync(ptr,len,MS_SYNC|MS_INVALIDATE);