]> Repositorios git - scryer-prolog.git/commitdiff
use newly available u8s_to_string
authorMarkus Triska <[email protected]>
Sat, 3 Sep 2022 19:25:19 +0000 (21:25 +0200)
committerMark Thom <[email protected]>
Thu, 27 Oct 2022 05:36:07 +0000 (23:36 -0600)
src/machine/system_calls.rs

index ba78afdc65242510d14d3755e0517929b3359a93..dd2b5bf4a5c19f0c45bc7e7fb8b0fab18041d459 100644 (file)
@@ -6635,13 +6635,9 @@ impl Machine {
             }
 
             let b64 = base64::encode_config(bytes, config);
-            let cstr = if b64.len() == 0 {
-                empty_list_as_cell!()
-            } else {
-                atom_as_cstr_cell!(self.machine_st.atom_tbl.build_with(&b64))
-            };
+            let string = self.u8s_to_string(&b64.as_bytes());
 
-            unify!(self.machine_st, self.machine_st.registers[2], cstr);
+            unify!(self.machine_st, self.machine_st.registers[2], string);
         }
 
         Ok(())