From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 6 Jan 2015 11:03:52 +0100 From: Gilles Chanteperdrix Message-ID: <20150106100352.GB11206@hermes.click-hack.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : sysregd: Unmount filesystems via fusermount List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org Cc: xenomai-git@xenomai.org On Mon, Jan 05, 2015 at 04:19:28PM +0100, git repository hosting wrote: > +static void unmount(const char *path) > +{ > + const char cmd_tmpl[] = "/usr/bin/fusermount -uzq "; > + char *cmd = malloc(sizeof(cmd_tmpl) + strlen(path)); > + > + if (cmd) { > + strcpy(cmd, cmd_tmpl); > + strcat(cmd, path); > + system(cmd); > + free(cmd); > + } > +} That is really ugly. Why not using asprintf ? -- Gilles.