Uninitialised value was created by a stack allocation

The meaning of the error is essentially that you’re using a variable before you assign to it. The only variables this can possibly apply to are ddmmyy.

This means that your sscanf call is not writing to all three of them. This will occur if you pass in a date that isn’t completely specified.

Note that sscanf returns a value to tell you how many of the variables it wrote to. You should be checking the return value, and aborting (or filling in some default values) if it doesn’t return 3, because then not all your fields will have been filled.

Leave a Comment