X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=blobdiff_plain;f=pico%2Fsek.c;h=517652878e74b1f55aac7b3d0c4f3cd47a6de7fc;hp=8bf0341b492a9b82e57c4308ce8f466a18a5d18e;hb=8f80007bcc94faae7c369d4ed8a07a9d35c31c72;hpb=d1b8bcc63466f6982685df518db8fef399f9cf91 diff --git a/pico/sek.c b/pico/sek.c index 8bf0341..5176528 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -302,7 +302,8 @@ void SekRegisterIdleHit(unsigned int pc) void SekInitIdleDet(void) { - unsigned short **tmp = realloc(idledet_ptrs, 0x200*4); + unsigned short **tmp; + tmp = realloc(idledet_ptrs, 0x200 * sizeof(tmp[0])); if (tmp == NULL) { free(idledet_ptrs); idledet_ptrs = NULL; @@ -410,7 +411,8 @@ int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx) } if (idledet_count >= 0x200 && (idledet_count & 0x1ff) == 0) { - unsigned short **tmp = realloc(idledet_ptrs, (idledet_count+0x200)*4); + unsigned short **tmp; + tmp = realloc(idledet_ptrs, (idledet_count+0x200) * sizeof(tmp[0])); if (tmp == NULL) return 1; idledet_ptrs = tmp;