Explorar o código

fix the wrong strcpy issue in list() function

Bernard Xiong %!s(int64=12) %!d(string=hai) anos
pai
achega
009eccf640
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      components/finsh/cmd.c

+ 1 - 1
components/finsh/cmd.c

@@ -620,7 +620,7 @@ long list(void)
              FINSH_NEXT_SYSCALL(index))
         {
 			/* skip the internal command */
-			if (strncpy((char*)index->name, "__", 2) == 0) continue;
+			if (strncmp((char*)index->name, "__", 2) == 0) continue;
 
 #ifdef FINSH_USING_DESCRIPTION
             rt_kprintf("%-16s -- %s\n", index->name, index->desc);