| 48 | (setting errno) if unsuccessful. */ |
| 49 | |
| 50 | static char * |
| 51 | samedir_template (char const *dstname, char buf[smallsize]) |
| 52 | { |
| 53 | ptrdiff_t dstdirlen = last_component (dstname) - dstname; |
| 54 | size_t dsttmpsize = dstdirlen + sizeof simple_pattern; |
| 55 | char *dsttmp; |
| 56 | if (dsttmpsize <= smallsize) |
| 57 | dsttmp = buf; |
| 58 | else |
| 59 | { |
| 60 | dsttmp = malloc (dsttmpsize); |
| 61 | if (!dsttmp) |
| 62 | return dsttmp; |
| 63 | } |
| 64 | strcpy (mempcpy (dsttmp, dstname, dstdirlen), simple_pattern); |
| 65 | return dsttmp; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | /* Auxiliaries for force_linkat. */ |
no outgoing calls
no test coverage detected