summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-05-22 16:54:04 +0200
committerRay <[email protected]>2021-05-22 16:54:04 +0200
commit03710c9d8ea5acb04445ce3d125b58da043df6ed (patch)
tree6e695068b1f5e34972dbb1b2196540007c5d49ca /src/core.c
parentcb698dd37db805a7d33445c22d6077fc35cf288d (diff)
downloadraylib-03710c9d8ea5acb04445ce3d125b58da043df6ed.tar.gz
raylib-03710c9d8ea5acb04445ce3d125b58da043df6ed.zip
Some code tweaks for consistency
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core.c b/src/core.c
index c5924595..e84d82c4 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2179,8 +2179,8 @@ Shader LoadShader(const char *vsFileName, const char *fsFileName)
shader.id = rlLoadShaderCode(vShaderStr, fShaderStr);
- if (vShaderStr != NULL) RL_FREE(vShaderStr);
- if (fShaderStr != NULL) RL_FREE(fShaderStr);
+ if (vShaderStr != NULL) UnloadFileText(vShaderStr);
+ if (fShaderStr != NULL) UnloadFileText(fShaderStr);
// After shader loading, we TRY to set default location names
if (shader.id > 0)
@@ -2801,8 +2801,8 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
ClearDirectoryFiles();
// Memory allocation for MAX_DIRECTORY_FILES
- dirFilesPath = (char **)RL_MALLOC(sizeof(char *)*MAX_DIRECTORY_FILES);
- for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
+ dirFilesPath = (char **)RL_MALLOC(MAX_DIRECTORY_FILES*sizeof(char *));
+ for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char));
int counter = 0;
struct dirent *entity;
@@ -5151,11 +5151,11 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths
{
ClearDroppedFiles();
- CORE.Window.dropFilesPath = (char **)RL_MALLOC(sizeof(char *)*count);
+ CORE.Window.dropFilesPath = (char **)RL_MALLOC(count*sizeof(char *));
for (int i = 0; i < count; i++)
{
- CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
+ CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char));
strcpy(CORE.Window.dropFilesPath[i], paths[i]);
}