From 17b0ec84edba5bbfbe9948dafe7c690b910faff9 Mon Sep 17 00:00:00 2001
From: AnHardt <github@kitelab.de>
Date: Tue, 2 Jun 2015 11:50:32 +0200
Subject: [PATCH] Fix out_of_range_error()

For sprintf_P() the first parameter has to be a `char*` not `const char*`.
---
 Marlin/Marlin_main.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index ec8072de77..f6dffba72d 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -2437,10 +2437,12 @@ inline void gcode_G28() {
 
 #elif defined(ENABLE_AUTO_BED_LEVELING)
 
-  void out_of_range_error(const char *edge) {
-    char msg[40];
-    sprintf_P(msg, PSTR("?Probe %s position out of range.\n"), edge);
-    SERIAL_PROTOCOL(msg);
+  void out_of_range_error(const char *p_edge) {
+    char edge[10];
+    strncpy_P(edge, p_edge, 10);
+    SERIAL_PROTOCOLPGM("?Probe ");
+    SERIAL_PROTOCOL(edge);
+    SERIAL_PROTOCOLLNPGM(" position out of range.");
   }
 
   /**