Skip to content

Why a "%d" specifier next to another "%d" specifier would crash the decompressor  #41

@ghost

Description

Make modifications to "sample/main.cc" as shown in the figure below,
image
Then compile and run the program,

$ cd sample
$ make
$ ./sampleApplication
$ ./decompressor decompress compressedLog

image
What I expected to output is "My number is 987654321123456789", but the actual output is "My number is 987654321987654321". It outputs the integer 987654321 twice but doesn't output the integer 123456789.
On top of that, the decompressor aborted.

adding a comma between the two "%d" specifiers could solve the problem,
image

I'm confusing and wondering whether this is a bug or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions