Record Detail

Wrong Answer

/in/database.c: In function 'main':
/in/database.c:94:25: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[15]' [-Wformat=]
                 scanf("%s",&glcourse);
                        ~^  ~~~~~~~~~
/in/database.c:99:25: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[15]' [-Wformat=]
                 scanf("%s",&glname);
                        ~^  ~~~~~~~
/in/database.c:119:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Insert(instr1));
             ^~~~~~
/in/database.c:133:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Save(instr1,instr2));
             ^~~~~~
/in/database.c:138:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Load(instr1));
             ^~~~~~
/in/database.c: In function 'Load':
/in/database.c:157:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (i=0;i<=len;i++)
                   ^~
/in/database.c:146:11: warning: unused variable 'line' [-Wunused-variable]
     char *line = (char *)malloc(256 * sizeof(char));
           ^~~~
/in/database.c: In function 'Save':
/in/database.c:224:16: warning: format not a string literal and no format arguments [-Wformat-security]
     fprintf(fp,db.tables[tablesign].name);
                ^~
/in/database.c: In function 'Printtable':
/in/database.c:473:12: warning: format not a string literal and no format arguments [-Wformat-security]
     printf(db.tables[tablesign].name);printf("\n");
            ^~
/in/database.c: In function 'List':
/in/database.c:497:16: warning: format not a string literal and no format arguments [-Wformat-security]
         printf(tablenamelist[i]);printf("\n");
                ^~~~~~~~~~~~~
/in/database.c: In function 'AUTO':
/in/database.c:583:29: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'char (*)[15]' [-Wformat=]
                 fscanf(fp,"%s",&glcourse);
                            ~^  ~~~~~~~~~
/in/database.c:588:29: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'char (*)[15]' [-Wformat=]
                 fscanf(fp,"%s",&glname);
                            ~^  ~~~~~~~
/in/database.c:608:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Insert(instr1));
             ^~~~~~
/in/database.c:622:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Save(instr1,instr2));
             ^~~~~~
/in/database.c:627:13: warning: format not a string literal and no format arguments [-Wformat-security]
             printf(Load(instr1));
             ^~~~~~
/in/database.c:525:9: warning: unused variable 'sign' [-Wunused-variable]
     int sign=0,type=0,limitnum;
         ^~~~
/in/database.c:519:11: warning: unused variable 'line' [-Wunused-variable]
     char *line = (char *)malloc(256 * sizeof(char));
           ^~~~
/in/database.c: In function 'Save':
/in/database.c:225:36: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
     for (i=0;i<db.tables[tablesign].assignNum;i++)
                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/in/database.c: In function 'Insert':
/in/database.c:260:62: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 db.tables[tablesign].assignments[i].deadline = tpddl;
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/in/database.c: In function 'Update':
/in/database.c:283:47: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int courseright[100],right[100],i,p=0,o=0,tablesign;
                                               ^~~~~~~~~
/in/database.c: In function 'Delete':
/in/database.c:342:47: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int courseright[100],right[100],i,p=0,o=0,tablesign;
                                               ^~~~~~~~~
/in/database.c: In function 'Select':
/in/database.c:452:26: warning: 'tpminsign' may be used uninitialized in this function [-Wmaybe-uninitialized]
             dfctright[i] = tpminsign;
             ~~~~~~~~~~~~~^~~~~~~~~~~
/in/database.c:393:62: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int courseright[100],right[100],dfctright[100],i,p=0,o=0,tablesign,tpmin,tpminsign;
                                                              ^~~~~~~~~
/in/database.c: In function 'Printtable':
/in/database.c:474:36: warning: 'tablesign' may be used uninitialized in this function [-Wmaybe-uninitialized]
     for (i=0;i<db.tables[tablesign].assignNum;i++)
                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /in/database.c:1:
In function 'fgets',
    inlined from 'Load.part.0' at /in/database.c:154:12,
    inlined from 'Load':
/usr/include/x86_64-linux-gnu/bits/stdio2.h:260:9: warning: call to '__fgets_chk_warn' declared with attribute warning: fgets called with bigger size than length of destination buffer
  return __fgets_chk_warn (__s, __bos (__s), __n, __stream);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Status Time Cost Memory Cost
#1 Wrong Answer Detail 1ms 336.0 KiB
#2 Wrong Answer Detail 1ms 256.0 KiB
#3 Wrong Answer Detail 1ms 368.0 KiB
#4 Wrong Answer Detail 1ms 384.0 KiB
#5 Wrong Answer Detail 1ms 264.0 KiB

Information

Submit By
Type
Submission
Homework
Lab 5 (TEST ONLY) (+AUTO)
Language
C
Submit At
2021-11-17 02:26:15
Judged At
2021-11-21 15:06:42
Judged By
Score
0
Total Time
6ms
Peak Memory
384.0 KiB