STYLE: Fix style issue

This commit is contained in:
Mathieu Malaterre 2006-07-22 03:27:36 +00:00
parent 4f87b9abd1
commit 0577ed8e6e
1 changed files with 3 additions and 6 deletions

View File

@ -786,14 +786,12 @@ int imagetopgx(opj_image_t * image, const char *outfile) {
const size_t olen = strlen(outfile); const size_t olen = strlen(outfile);
const size_t dotpos = olen - 4; const size_t dotpos = olen - 4;
const size_t total = dotpos + 1 + 1 + 4; /* '-' + '[1-3]' + '.pgx' */ const size_t total = dotpos + 1 + 1 + 4; /* '-' + '[1-3]' + '.pgx' */
if( outfile[dotpos] != '.' ) if( outfile[dotpos] != '.' ) {
{
/* `pgx` was recognized but there is no dot at expected position */ /* `pgx` was recognized but there is no dot at expected position */
fprintf(stderr, "ERROR -> Impossible happen." ); fprintf(stderr, "ERROR -> Impossible happen." );
return 1; return 1;
} }
if( total > 256 ) if( total > 256 ) {
{
name = (char*)malloc(total+1); name = (char*)malloc(total+1);
} }
strncpy(name, outfile, dotpos); strncpy(name, outfile, dotpos);
@ -808,8 +806,7 @@ int imagetopgx(opj_image_t * image, const char *outfile) {
return 1; return 1;
} }
/* dont need name anymore */ /* dont need name anymore */
if( total > 256 ) if( total > 256 ) {
{
free(name); free(name);
} }
/* w = int_ceildiv(image->x1 - image->x0, comp->dx); */ /* w = int_ceildiv(image->x1 - image->x0, comp->dx); */