From 68160e6af0831e6ae6796b760764554b708f4de2 Mon Sep 17 00:00:00 2001
From: fmoletta <99273364+fmoletta@users.noreply.github.com>
Date: Mon, 17 Apr 2023 18:09:01 +0300
Subject: [PATCH] Add missing `\n` character in traceback string (#997)

* Add missing \n character

* Add changelog entry

---------

Co-authored-by: Juan Bono <juanbono94@gmail.com>
---
 CHANGELOG.md                  | 4 ++++
 src/vm/errors/vm_exception.rs | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a0c85a88c..89a024d1ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
 ## Cairo-VM Changelog
 
 #### Upcoming Changes
+
+* Add missing `\n` character in traceback string [#997](https://github.com/lambdaclass/cairo-rs/pull/997)
+    * BugFix: Add missing `\n` character after traceback lines when the filename is missing ("Unknown Location")
+
 * 0.11 Support
     * Layouts update [#874](https://github.com/lambdaclass/cairo-rs/pull/874)
     * Keccak builtin updated [#873](https://github.com/lambdaclass/cairo-rs/pull/873), [#883](https://github.com/lambdaclass/cairo-rs/pull/883)
diff --git a/src/vm/errors/vm_exception.rs b/src/vm/errors/vm_exception.rs
index e5bf11f0f6..a3a67aefa8 100644
--- a/src/vm/errors/vm_exception.rs
+++ b/src/vm/errors/vm_exception.rs
@@ -101,7 +101,10 @@ pub fn get_traceback(vm: &VirtualMachine, runner: &CairoRunner) -> Option<String
                 "{}\n",
                 location.to_string_with_content(&format!("(pc=0:{})", traceback_pc.offset))
             )),
-            None => traceback.push_str(&format!("Unknown location (pc=0:{})", traceback_pc.offset)),
+            None => traceback.push_str(&format!(
+                "Unknown location (pc=0:{})\n",
+                traceback_pc.offset
+            )),
         }
     }
     (!traceback.is_empty())