Skip to content

SET MEMOWIDTH wrong limits #16

Open

Description

@atlopes

In foxvm/src/vm.rs:

            "MEMOWIDTH" => {
                let n = args.first().map(Value::as_number).transpose()?.unwrap_or(50.0);
                if !(8.0..=256.0).contains(&n) {
                    return Err(RtError::function_arg_invalid());
                }
                self.settings.memowidth = n as u8;
            }

Specifying a memo width lower than 8 should raise an error (if you plan to match VFP and FoxDev errors, that would be error 47), but setting a value greater than the upper limit of 8192 - and not 256 - should silently set the memo width to 8192.

Therefore, self.settings.memowidth must be a u16.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions