From: Ben Pfaff Date: Tue, 24 Dec 2024 19:29:05 +0000 (-0800) Subject: long strin gmissing values X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7da598c6bfb344b0e3604efd9e45590808353e42;p=pspp long strin gmissing values --- diff --git a/rust/pspp/src/cooked.rs b/rust/pspp/src/cooked.rs index 959515a02f..cb8dbe6d75 100644 --- a/rust/pspp/src/cooked.rs +++ b/rust/pspp/src/cooked.rs @@ -681,9 +681,17 @@ pub fn decode( warn(Error::TBD); continue; }; - for (value, label) in record.labels.into_iter() { - let value = Value:: - variable.value_labels.insert(value) + let Some(width) = variable.width.as_string_width() else { + warn(Error::TBD); + continue; + }; + for (mut value, label) in record.labels.into_iter() { + // XXX warn about too-long value? + value.0.resize(width, b' '); + // XXX warn abouat duplicat value labels? + variable + .value_labels + .insert(Value::String(value.0.into_boxed_slice()), label); } }