mardi 17 novembre 2020

check if character is printable for hex-dump

for checking wether or not a char can be printed in hex or not I have a condition like this:

            if(*buff >= 32 && *buff <=126){
                fprintf(stout, "%c", *buff);
                } else { 
                    fprintf(stout, ".");
             }

hower it seems to fail at some points and I dont understand why. Any ideas why that is or how I could fix the condition?

Aucun commentaire:

Enregistrer un commentaire