/[path-sandbox]/tags/sandbox_1_2_13/canonicalize.c
Gentoo

Diff of /tags/sandbox_1_2_13/canonicalize.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 26 Revision 29
161 if (dest > rpath + 1 && dest[-1] == '/') 161 if (dest > rpath + 1 && dest[-1] == '/')
162 --dest; 162 --dest;
163#endif 163#endif
164 *dest = '\0'; 164 *dest = '\0';
165 165
166 return resolved ? memcpy(resolved, rpath, dest - rpath + 1) : rpath; 166 return resolved ? rpath : memcpy(resolved, rpath, dest - rpath + 1);
167 167
168error: 168error:
169 if (resolved) 169 if (resolved)
170 strcpy(resolved, rpath); 170 strncpy(resolved, rpath, path_max - 1);
171 else 171 else
172 free(rpath); 172 free(rpath);
173 return NULL; 173 return NULL;
174} 174}
175 175
176// vim:expandtab noai:cindent ai 176// vim:noexpandtab noai:cindent ai

Legend:
Removed from v.26  
changed lines
  Added in v.29

  ViewVC Help
Powered by ViewVC 1.1.20