[rtems commit] shell/main_edit.c: Fix use of wrong constant

Sebastian Huber sebh at rtems.org
Thu Oct 15 17:23:00 UTC 2020


Module:    rtems
Branch:    master
Commit:    b03c103dbd3093ebbcd808122be5b04aa2678f57
Changeset: http://git.rtems.org/rtems/commit/?id=b03c103dbd3093ebbcd808122be5b04aa2678f57

Author:    Frank Kühndel <frank.kuehndel at embedded-brains.de>
Date:      Mon Oct 12 18:06:30 2020 +0200

shell/main_edit.c: Fix use of wrong constant

realpath() requires a buffer of size PATH_MAX and not of size
FILENAME_MAX according to 'man realpath (3)'.

---

 cpukit/libmisc/shell/main_edit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/libmisc/shell/main_edit.c b/cpukit/libmisc/shell/main_edit.c
index e43ff68..02214bd 100644
--- a/cpukit/libmisc/shell/main_edit.c
+++ b/cpukit/libmisc/shell/main_edit.c
@@ -32,6 +32,7 @@
 //
 
 #include <signal.h>
+#include <limits.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -282,7 +283,7 @@ static void delete_editor(struct editor *ed) {
 }
 
 static struct editor *find_editor(struct env *env, char *filename) {
-  char fn[FILENAME_MAX];
+  char fn[PATH_MAX];
   struct editor *ed = env->current;
   struct editor *start = ed;
 



More information about the vc mailing list