diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-04 07:07:30 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-04 07:07:30 +0000 |
commit | 1c3ebcd88e9bc4c2e3bc81e3ebf1947757432b26 (patch) | |
tree | e09e48629292b0b2982f3fabcfdb9350c85352b7 /wk4/pset/recover/recover.c | |
parent | 307c5f4d10eb51a26e1f6f59101b48e62d25b1ba (diff) |
Thu, Apr 4, 2024, 12:07 AM -07:00
Diffstat (limited to 'wk4/pset/recover/recover.c')
-rw-r--r-- | wk4/pset/recover/recover.c | 11 |
1 files 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 + } } |