Long varLabels truncated to 120 characters

Issue #5 resolved
Former user created an issue

Great job ! It seems that in module header.py, class Header, method varLabels, the function "funcL" is never called because "funcS" always return a varLabel <= 120.

Comments (4)

  1. Albert-Jan Roskam repo owner

    Hi, this line:

    retcode = funcL(c_int(self.fh), c_char_p(varName),
                                    byref(varLabel), c_int(lenBuff), byref(c_int))
    

    ... seems awfully wrong, without having tested it it should be (notice added parenthesis in the last argument):

    retcode = funcL(c_int(self.fh), c_char_p(varName),
                                    byref(varLabel), c_int(lenBuff), byref(c_int()))
    

    I'd have to test this though. Another option would be to define lenLabel = c_int() and then use byref(lenLabel) as the last arg. Could you let me know if this is the fix? Thanks!

  2. Albert-Jan Roskam repo owner

    I think you're right: the funcL alone should be sufficient. I misinterpreted the documentation. I hope I have some time during the weekend to ditch all references to funcS. Can you confirm that using funcL for varLabels < 120 bytes also works?

  3. Log in to comment