VMiklos: add STRNCPY macro from alpm to pacman
This commit is contained in:
parent
953e7e5d3e
commit
a074ddb85b
|
@ -451,7 +451,7 @@ int downloadfiles_forreal(list_t *servers, const char *localpath,
|
||||||
if(!strcmp(server->protocol, "file")) {
|
if(!strcmp(server->protocol, "file")) {
|
||||||
char out[56];
|
char out[56];
|
||||||
printf(" %s [", sync_fnm);
|
printf(" %s [", sync_fnm);
|
||||||
strncpy(out, server->path, 33);
|
STRNCPY(out, server->path, 33);
|
||||||
printf("%s", out);
|
printf("%s", out);
|
||||||
for(j = strlen(out); j < maxcols-64; j++) {
|
for(j = strlen(out); j < maxcols-64; j++) {
|
||||||
printf(" ");
|
printf(" ");
|
||||||
|
|
|
@ -28,6 +28,11 @@
|
||||||
|
|
||||||
#define FREE(p) do { if (p) { free(p); (p) = NULL; }} while(0)
|
#define FREE(p) do { if (p) { free(p); (p) = NULL; }} while(0)
|
||||||
|
|
||||||
|
#define STRNCPY(s1, s2, len) do { \
|
||||||
|
strncpy(s1, s2, (len)-1); \
|
||||||
|
s1[(len)-1] = 0; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
int makepath(char *path);
|
int makepath(char *path);
|
||||||
int rmrf(char *path);
|
int rmrf(char *path);
|
||||||
void indentprint(char *str, int indent);
|
void indentprint(char *str, int indent);
|
||||||
|
|
Loading…
Reference in New Issue