Displaying 4 results from an estimated 4 matches for "guestfishxxxxxx".
2016 Mar 07
0
Re: [PATCH v2] Use less stack.
...t char *editor;
> int r;
> struct stat oldstat, newstat;
> - char buf[BUFSIZ];
> + CLEANUP_FREE char *tmpfd = NULL;
> + CLEANUP_FREE char *editcmd = NULL;
>
> CLEANUP_FREE char *tmpdir = guestfs_get_tmpdir (g), *tmp = NULL;
> if (asprintf (&tmp, "%s/guestfishXXXXXX", tmpdir) == -1) {
> @@ -119,9 +120,12 @@ run_hexedit (const char *cmd, size_t argc, char *argv[])
> if (editor == NULL)
> editor = "hexedit";
>
> - snprintf (buf, sizeof buf, "/dev/fd/%d", fd);
> + if (asprintf (&tmpfd, "/dev/fd/%d&qu...
2016 Mar 07
2
[PATCH v2] Use less stack.
...dir (g), *template = NULL;
int fd;
size_t markerlen;
- char buffer[BUFSIZ];
+ CLEANUP_FREE char *buffer = NULL;
int write_error = 0;
+ buffer = malloc (BUFSIZ);
+ if (buffer == NULL) {
+ perror ("malloc");
+ return NULL;
+ }
+
if (asprintf (&template, "%s/guestfishXXXXXX", tmpdir) == -1) {
perror ("asprintf");
return NULL;
@@ -1865,7 +1871,7 @@ file_in_heredoc (const char *endmarker)
markerlen = strlen (endmarker);
- while (fgets (buffer, sizeof buffer, stdin) != NULL) {
+ while (fgets (buffer, BUFSIZ, stdin) != NULL) {
/* Loo...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.
2014 Aug 28
14
[PATCH 00/13] code refactorings for tools
Hi,
this series does a couple of code reorganizations/refactoring in code
used by tools: the windows path handling code, and the two types of
file editing (using editor, and using perl expression).
There's still a code duplication between the two variants of file
editing, but it is just within a single source, and can be easily
solved now (planning as next step).
Pino Toscano (13):
edit: