ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.46 by tdb, Wed Apr 7 09:44:08 2004 UTC vs.
Revision 1.47 by ats, Wed Apr 7 10:27:53 2004 UTC

# Line 112 | Line 112 | static void add_mapping(char *bsd, char *svr){
112          }
113  
114          map_ptr->next = NULL;
115 <        map_ptr->bsd = strdup(bsd);
116 <        map_ptr->svr = strdup(svr);
115 >        map_ptr->bsd = NULL;
116 >        map_ptr->svr = NULL;
117 >        if (sg_update_string(&map_ptr->bsd, bsd) < 0
118 >            || sg_update_string(&map_ptr->svr, svr) < 0) {
119 >                return;
120 >        }
121  
122          return;
123   }
# Line 123 | Line 127 | static char *read_dir(char *disk_path){
127          DIR *dirp;
128          struct dirent *dp;
129          struct stat stbuf;
130 <        char *svr_name;
130 >        char *svr_name = NULL;
131          char current_dir[MAXPATHLEN];
132          char file_name[MAXPATHLEN];
133          char temp_name[MAXPATHLEN];
# Line 150 | Line 154 | static char *read_dir(char *disk_path){
154                          x = readlink(dir_dname, file_name, sizeof(file_name));
155                          file_name[x] = '\0';
156                          if (strcmp(file_name, temp_name) == 0) {
157 <                                svr_name = strdup(dp->d_name);
157 >                                if (sg_update_string(&svr_name,
158 >                                                     dp->d_name) < 0) {
159 >                                        return NULL;
160 >                                }
161                                  closedir(dirp);
162                                  return svr_name;
163                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines