Skip to content

Commit f44743d

Browse files
committed
Return empty string if error
1 parent 13fb0f3 commit f44743d

File tree

1 file changed

+2
-0
lines changed
  • ledger_device_sdk/src/libcall

1 file changed

+2
-0
lines changed

ledger_device_sdk/src/libcall/swap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ pub fn swap_return(res: SwapResult) {
239239
unsafe { *(p.amount_str.add(i)) = c as i8 };
240240
}
241241
unsafe { *(p.amount_str.add(s.len())) = '\0' as i8 };
242+
} else {
243+
unsafe { *(p.amount_str) = '\0' as i8 };
242244
}
243245
}
244246
SwapResult::CreateTxResult(&mut ref p, r) => {

0 commit comments

Comments
 (0)