Philip Dinu wrote: > Hi, > > I'm currently working on using the libfprint for implementing > fingerprint recognition on an embedded system, but I'm running into a > snag... I'm having problems reading (or writing) fingerprint data to > a flat file using the fp_print_data_get_data function. (This is > probably more of a general C question then a libfprint question) > > Here's pretty much what I'm doing: > -- > struct fp_print_data *data > unsigned char *print; > > //stuff > > fp_print_data_get_data(data, &print); > fprintf(fp, print); > -- > The value in print it actually stores looks something like "FP1\002" > Now, when trying to read it: > -- > r = fread(uprint, 1, 10, fp); > print = fp_print_data_from_data(uprint, r); > -- > I've tried using all the different fgets, fscanf, etc... but > fp_print_data_from_data is always returning NULL. > > Any idea's or suggestions would be a great help. >
You can't use fprintf to write binary data to a file. The second argument of fprintf is a format string, not random data. Use write (2) instead. /Lukas _______________________________________________ fprint mailing list [email protected] http://lists.reactivated.net/mailman/listinfo/fprint
