From 1c3ebcd88e9bc4c2e3bc81e3ebf1947757432b26 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Thu, 4 Apr 2024 07:07:30 +0000 Subject: Thu, Apr 4, 2024, 12:07 AM -07:00 --- wk4/pset/recover/recover.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wk4/pset/recover/recover.c b/wk4/pset/recover/recover.c index d401ff7..b5e5b41 100644 --- a/wk4/pset/recover/recover.c +++ b/wk4/pset/recover/recover.c @@ -22,8 +22,15 @@ int main(int argc, char *argv[]) fread(infile, sizeof(RGBTRIPLE), width, inptr); /* - if (first 3 bytes are 0xff 0xd8 0xff AND 4th byte is 0xe* (* denotes anything)) { - this is a photo; remember the pointer + for (file length) { + if (first 3 bytes are 0xff 0xd8 0xff AND 4th byte is 0xe* (* denotes anything)) { + this is a photo; remember the pointer + look through the blocks ahead of this one for a new photo + for (file length left) { + add + if (first 3 bytes are 0xff 0xd8 0xff AND 4th byte is 0xe* (* denotes anything)) { + the + } } -- cgit v1.2.3