File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -722,17 +722,15 @@ LinkTable *LinkTable_disk_open(const char *dirn)
722722 FREE (metadirn );
723723
724724 if (!fp ) {
725+ lprintf (debug , "Linktable at %s does not exist." , path );
725726 FREE (path );
726727 return NULL ;
727728 }
728729
729730 LinkTable * linktbl = CALLOC (1 , sizeof (LinkTable ));
730731
731- if (sizeof (int ) != fread (& linktbl -> num , sizeof (int ), 1 , fp )) {
732- /*
733- * reached EOF
734- */
735- lprintf (error , "reached EOF!\n" );
732+ if (fread (& linktbl -> num , sizeof (int ), 1 , fp ) != 1 ) {
733+ lprintf (error , "Failed to read the first int of %s!\n" , path );
736734 LinkTable_free (linktbl );
737735 LinkTable_disk_delete (dirn );
738736 return NULL ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ struct LinkTable {
4343struct Link {
4444 /** \brief The link name in the last level of the URL */
4545 char linkname [MAX_FILENAME_LEN + 1 ];
46+ /** \brief This is for storing the unescaped path */
4647 char linkpath [MAX_FILENAME_LEN + 1 ];
4748 /** \brief The full URL of the file */
4849 char f_url [MAX_PATH_LEN + 1 ];
@@ -116,6 +117,7 @@ int LinkTable_disk_save(LinkTable *linktbl, const char *dirn);
116117
117118/**
118119 * \brief load a link table from the disk.
120+ * \param[in] dirn We expected the unescaped_path here!
119121 */
120122LinkTable * LinkTable_disk_open (const char * dirn );
121123
You can’t perform that action at this time.
0 commit comments