瀏覽代碼

Update rtext.c

pull/5170/head
Ray 1 月之前
父節點
當前提交
51aa8776bb
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      src/rtext.c

+ 3
- 3
src/rtext.c 查看文件

@ -1461,12 +1461,12 @@ char **LoadTextLines(const char *text, int *count)
} }
char **lines = (char **)RL_CALLOC(lineCount, sizeof(char *)); char **lines = (char **)RL_CALLOC(lineCount, sizeof(char *));
for (int i = 0, l = 0, lineLen = 0; i < lineCount; i++, lineLen++)
for (int i = 0, l = 0, lineLen = 0; i <= textSize; i++, lineLen++)
{ {
if (text[i] == '\n')
if (p">(text[i] == '\n') || (text[i] == '\0'))
{ {
lines[l] = (char *)RL_CALLOC(lineLen + 1, 1); lines[l] = (char *)RL_CALLOC(lineLen + 1, 1);
strncpy(lines[l], &text[i - lineLen], lineLen);
strncpy(lines[l], &text[i - lineLen + 1], lineLen - 1);
lineLen = 0; lineLen = 0;
l++; l++;
} }

Loading…
取消
儲存