[RUNTIME][CRT] use macro to replace hardcode number (#6365)
authorwindclarion <windclarion@gmail.com>
Wed, 2 Sep 2020 17:19:57 +0000 (01:19 +0800)
committerGitHub <noreply@github.com>
Wed, 2 Sep 2020 17:19:57 +0000 (10:19 -0700)
Signed-off-by: windclarion <windclarion@gmail.com>
src/runtime/crt/graph_runtime/graph_runtime.c

index d93e909..01b07dc 100644 (file)
@@ -606,7 +606,7 @@ int TVMGraphRuntime_LoadParams(TVMGraphRuntime* runtime, const char* param_blob,
     uint64_t name_length;
     name_length = ((uint64_t*)bptr)[0];  // NOLINT(*)
     bptr += sizeof(name_length);
-    if (name_length >= 80) {
+    if (name_length >= TVM_CRT_STRLEN_NAME) {
       fprintf(stderr, "Error: function name longer than expected.\n");
       status = -1;
     }