diff options
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 + } } |