Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Informatik 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wadi.T
Informatik 2
Commits
7985f657
Commit
7985f657
authored
2 years ago
by
T.Wadi
Browse files
Options
Downloads
Patches
Plain Diff
bug fix
parent
bb578673
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
cds.c
+6
-4
6 additions, 4 deletions
cds.c
cds.h
+2
-1
2 additions, 1 deletion
cds.h
datastructure.h
+1
-1
1 addition, 1 deletion
datastructure.h
test.exe.stackdump
+18
-0
18 additions, 0 deletions
test.exe.stackdump
tools.c
+9
-5
9 additions, 5 deletions
tools.c
with
36 additions
and
11 deletions
cds.c
+
6
−
4
View file @
7985f657
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
"datastructure.h"
#include
"datastructure.h"
#include
"cds.h"
#include
"cds.h"
#include
"tools.h"
#include
"tools.h"
const
int
countCDs
=
100
;
int
countCDs
;
sCD
CDData
[
MAXSONGS
];
sCD
CDData
[
MAXSONGS
];
void
createCD
(){
void
createCD
(){
puts
(
"CreateCD"
);
waitForEnter
();
}
}
void
editCd
(){
void
editCd
(){
puts
(
"editCd"
);
puts
(
"editCd"
);
waitForEnter
();
waitForEnter
();
...
...
This diff is collapsed.
Click to expand it.
cds.h
+
2
−
1
View file @
7985f657
...
@@ -5,4 +5,5 @@ void editCd();
...
@@ -5,4 +5,5 @@ void editCd();
void
deleteCD
();
void
deleteCD
();
void
searchSong
();
void
searchSong
();
void
sortCDs
();
void
sortCDs
();
void
ListCDs
();
void
ListCDs
();
\ No newline at end of file
void
creatSong
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
datastructure.h
+
1
−
1
View file @
7985f657
...
@@ -40,7 +40,7 @@ void inputDate();
...
@@ -40,7 +40,7 @@ void inputDate();
/************************************************************************************************/
/************************************************************************************************/
/***********************************Externvariables****************************************/
/***********************************Externvariables****************************************/
/************************************************************************************************/
/************************************************************************************************/
extern
const
int
countCDs
;
extern
int
countCDs
;
extern
sCD
CDData
[];
extern
sCD
CDData
[];
This diff is collapsed.
Click to expand it.
test.exe.stackdump
0 → 100644
+
18
−
0
View file @
7985f657
Exception: STATUS_ACCESS_VIOLATION at rip=001004019AA
rax=0000000000000000 rbx=0000000180367B36 rcx=0000000180243A80
rdx=0000000800050830 rsi=0000000000000000 rdi=0000000000000000
r8 =00000008000587A0 r9 =0000000000007F61 r10=0000000100000000
r11=00000001004019A3 r12=00000000FFFFCC80 r13=00000000FFFFCDF0
r14=0000000000000000 r15=0000000000000000
rbp=00000000FFFFCB80 rsp=00000000FFFFCB30
program=C:\Users\touil\OneDrive\Dokumente\Uni\informatik-2\test.exe, pid 1881, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
000FFFFCB80 001004019AA (00000000042, 00000000000, 00000000000, 0000000001F)
000FFFFCBC0 001004010A9 (000FFFFCBF0, 00000000007, 00000000000, 00100404035)
000FFFFCC30 00100401590 (00180049B21, 00180048A70, 00000000002, 00180322FC0)
000FFFFCD30 00180049B8D (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 00180047746 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 001800477F4 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
This diff is collapsed.
Click to expand it.
tools.c
+
9
−
5
View file @
7985f657
...
@@ -99,6 +99,7 @@ void printLine(char zeichen, unsigned int limit)
...
@@ -99,6 +99,7 @@ void printLine(char zeichen, unsigned int limit)
int
getText
(
char
*
prompt
,
unsigned
int
maxLength
,
char
**
pointerToString
,
int
stringOption
){
int
getText
(
char
*
prompt
,
unsigned
int
maxLength
,
char
**
pointerToString
,
int
stringOption
){
if
(
!
pointerToString
)
return
0
;
if
(
!
pointerToString
)
return
0
;
*
pointerToString
=
NULL
;
char
*
input
;
char
*
input
;
char
format
[
20
];
char
format
[
20
];
unsigned
int
stringLength
;
unsigned
int
stringLength
;
...
@@ -106,22 +107,26 @@ int getText(char* prompt, unsigned int maxLength, char** pointerToString, int st
...
@@ -106,22 +107,26 @@ int getText(char* prompt, unsigned int maxLength, char** pointerToString, int st
input
=
malloc
(
maxLength
+
1
);
input
=
malloc
(
maxLength
+
1
);
if
(
input
)
if
(
input
)
{
{
sprintf
(
format
,
"%%%i[^
/
n]"
,
maxLength
);
sprintf
(
format
,
"%%%i[^
\
n
]"
,
maxLength
);
do
do
{
{
puts
(
prompt
);
puts
(
prompt
);
*
input
=
'\0'
;
scanf
(
format
,
input
);
scanf
(
format
,
input
);
clearBuffer
();
clearBuffer
();
stringLength
=
strlen
(
input
)
+
1
;
stringLength
=
strlen
(
input
)
+
1
;
if
(
stringLength
>
1
)
if
(
stringLength
>
1
)
{
{
strncpy
(
input
,
*
pointerToString
,
stringLength
);
*
pointerToString
=
malloc
(
stringLength
);
if
(
*
pointerToString
){
strncpy
(
*
pointerToString
,
input
,
stringLength
+
1
);
loopExit
=
1
;
loopExit
=
1
;
}
}
}
else
if
(
stringOption
)
loopExit
=
1
;
else
if
(
stringOption
)
loopExit
=
1
;
}
while
(
loopExit
!=
1
);
}
while
(
loopExit
!=
1
);
free
(
input
);
free
(
input
);
return
-
1
;
return
1
;
}
}
else
return
0
;
else
return
0
;
}
}
...
@@ -133,13 +138,12 @@ int getText(char* prompt, unsigned int maxLength, char** pointerToString, int st
...
@@ -133,13 +138,12 @@ int getText(char* prompt, unsigned int maxLength, char** pointerToString, int st
int
getNumber
(
char
*
prompt
,
int
*
pointerToInteger
,
unsigned
int
min
,
unsigned
int
max
){
int
getNumber
(
char
*
prompt
,
int
*
pointerToInteger
,
unsigned
int
min
,
unsigned
int
max
){
int
input
;
int
input
;
if
(
!
pointerToInteger
)
return
0
;
do
do
{
{
puts
(
prompt
);
puts
(
prompt
);
scanf
(
"%i"
,
&
input
);
scanf
(
"%i"
,
&
input
);
clearBuffer
();
clearBuffer
();
*
pointerToInteger
=
input
;
}
while
((
input
<
min
)
||
(
input
>
max
));
}
while
((
input
<
min
)
||
(
input
>
max
));
*
pointerToInteger
=
input
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment