Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iffy handling 2-03-YYY #59

Open
vsouvan opened this issue Apr 19, 2020 · 1 comment
Open

iffy handling 2-03-YYY #59

vsouvan opened this issue Apr 19, 2020 · 1 comment

Comments

@vsouvan
Copy link
Collaborator

vsouvan commented Apr 19, 2020

Code in question is bufr_dataset.c:1778,

  case TYPE_CHNG_REF_VAL_OP :
     ival = bufr_value_get_int32( bd->value );
     if (isdebug)
        {
        sprintf( errmsg, _("INT: %llu "), (unsigned long long)ival );
        bufr_print_debug( errmsg );
        }
     if (ival < 0)
        {
        ival = bufr_negative_ivalue( ival, bd->encoding.nbits );

ival is uint64_t, which makes the "if (ival < 0)" test a NOP. Not entirely sure what was intended here so I added a FIXME comment and left it alone.


Imported from Launchpad using lp2gh.

@vsouvan
Copy link
Collaborator Author

vsouvan commented Apr 19, 2020

(by vanh-souvanlasy)
The return value could be negative and for this case, the returned value is not just -1 for missing
the ival should be int32_t and then the converted final value should be cast to uint64_t for output.

@vsouvan vsouvan added this to the 0.8.4 milestone Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant