Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs3-22sp
math-evaluator
Commits
4738bf61
Commit
4738bf61
authored
3 years ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
fix memory leak
parent
6d7287b8
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-1
Makefile
src/main.c
+4
-0
src/main.c
with
5 additions
and
1 deletion
+5
-1
Makefile
View file @
4738bf61
SOURCES
:=
$(
wildcard
library/
*
.c
)
$(
wildcard
src/
*
.c
)
bin/eval
:
$(SOURCES)
clang
$^
-g
-Iinclude
-fsanitize
=
address,undefined
-lreadline
-o
bin/eval
clang
$^
-g
-Iinclude
-fsanitize
=
address,undefined
,leak
-lreadline
-o
bin/eval
clean
:
rm
-f
bin/
*
This diff is collapsed.
Click to expand it.
src/main.c
View file @
4738bf61
...
...
@@ -11,6 +11,10 @@ int main(int argc, char *argv[]) {
char
*
temp
=
readline
(
"expr> "
);
do
{
if
(
!
strcmp
(
temp
,
"exit"
)
||
!
strcmp
(
temp
,
"quit"
))
{
free
(
temp
);
return
0
;
}
add_history
(
temp
);
//expression_t *expr = expression_cfold(expression_parse(temp));
expression_t
*
expr
=
expression_parse
(
temp
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help