add more warning

This commit is contained in:
2025-05-22 19:36:39 +08:00
parent 3622cac8a8
commit f46a2824e8

View File

@@ -302,6 +302,13 @@ impl Script for CircusMesScript {
s = s.replace(i.0.as_str(), i.1.as_str());
}
let mut text = encode_string(encoding, &s, false)?;
if text.contains(&self.info.deckey) {
eprintln!(
"Warning: text contains deckey, text may be truncated: {}",
s
);
crate::COUNTER.inc_warning();
}
buffer.push(token.value);
for t in text.iter_mut() {
*t = (*t).overflowing_sub(self.info.deckey).0;