From 8d2f3630e98e198eddbd04861ff483c2b50f5467 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Thu, 27 Sep 2018 18:34:45 +0200 Subject: [PATCH] Add sanity check to ensure debugger (or patch) aren't buggy, also let's keep it disabled --- libbps.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libbps.cpp b/libbps.cpp index b110c18..2ba21ef 100644 --- a/libbps.cpp +++ b/libbps.cpp @@ -490,7 +490,7 @@ struct bpsinfo bps_get_info(file* patch, bool changefrac) -#if 1 +#if 0 #warning Disable this in release versions. #include @@ -575,6 +575,9 @@ void bps_dump(struct mem patch) break; } } + + printf("sanity check: %zu=%zu (%+zi), ", patchat-patch.ptr, patchend-patch.ptr, patchat-patchend); + printf("%zu=%zu (%+zi)", outat, outlen, outat-outlen); #undef read8 #undef decodeto }