This is mainly an issue on Windows because it's file system is case-insensitive (though it could be an issue on other systems that are using a case-insenstive filesystem e.g. on the SD card). cr2hdr uses the input filename with the last three letters replaced with "DNG" (uppercase) for the output filename:
snprintf(out_filename, sizeof(out_filename), "%s", filename);
out_filename[len-3] = 'D';
out_filename[len-2] = 'N';
out_filename[len-1] = 'G';
On Windows, this means that if you give it a file that ends with .dng, it will replace that filename to end with .DNG and assume that its either a different file, or you are simply asking it to re-convert an existing converted file. On Windows, this will actually be the same file. You can use the --skip-existing command line option to prevent overwriting, but then it simply won't convert your file.
Also, if you give cr2hdr a filename with less than 3 characters, this code results in a buffer underflow, which didn't actually cause a crash or anything on my system when I tried it, but you end up with an output file called simply "NG" or just "G". It also screws up if you give it unicode characters, for example I tried a file called "test.

" (0x1F642) and it said the output file was: "test.?DNG", but it just overwrote the original.
There's also this comment in the code:
/* note: we only save uppercase .DNGs, so a case-sensitive extension check should be fine */
which is also not a very safe assumption to make.
Bottom line: this file handling code probably needs to be cleaned up. This would probably be considered an
easy coding task, great for someone interested in getting started with contributing to ML.