- 325773 : ignoring return value of 'fread', declared with attribute warn_unused_result
- 347249 : format '%ld' expects argument of type 'long int'
Change-Id: I8ec62253afb4649cc7d8a4c810bcba5b5b03ad84
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
printf("Can't get cert chain\n");
goto exit;
}
- printf("Cert is %ld bytes\n", cert_chain_len);
+ printf("Cert is %d bytes\n", cert_chain_len);
printf("Received cert %s\n", cert_chain);
result = dcm_get_key_bit_length(key_ctx, &key_len);
char * buffer = (char *)malloc(size);
- fread(buffer, 1, size, infile);
+ size_t readno = fread(buffer, 1, size, infile);
fclose(infile);
+ if(readno <= 0) {
+ printf("Fail to read a file(%s)", argv[1]);
+ return -1;
+ }
+
fprintf(outfile, "#include <sys/types.h>\nsize_t %s_size = %zd;\nunsigned char %s[]= {\n",
argv[3], size, argv[3]);