From: <ai...@us...> - 2013-11-18 21:54:29
|
Revision: 12714 http://sourceforge.net/p/plplot/code/12714 Author: airwin Date: 2013-11-18 21:54:26 +0000 (Mon, 18 Nov 2013) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/bindings/tk/plserver.c trunk/drivers/tk.c trunk/src/plstdio.c Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2013-11-18 21:45:22 UTC (rev 12713) +++ trunk/bindings/tk/plserver.c 2013-11-18 21:54:26 UTC (rev 12714) @@ -115,7 +115,7 @@ // Save arglist to get around Tk_ParseArgv limitations - myargv = (const char **) malloc( argc * sizeof(char *) ); + myargv = (const char **) malloc( argc * sizeof ( char * ) ); for ( i = 0; i < argc; i++ ) { myargv[i] = argv[i]; Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2013-11-18 21:45:22 UTC (rev 12713) +++ trunk/drivers/tk.c 2013-11-18 21:54:26 UTC (rev 12714) @@ -1518,10 +1518,10 @@ static void link_init( PLStream *pls ) { - TkDev *dev = (TkDev *) pls->dev; - PLiodev *iodev = (PLiodev *) dev->iodev; - size_t bufmax = (size_t) ( pls->bufmax * 1.2 ); - char *dirname = NULL; + TkDev *dev = (TkDev *) pls->dev; + PLiodev *iodev = (PLiodev *) dev->iodev; + size_t bufmax = (size_t) ( pls->bufmax * 1.2 ); + char *dirname = NULL; dbug_enter( "link_init" ); @@ -1529,11 +1529,11 @@ if ( !pls->dp ) { - // This uses the pl_create_tempfifo function to create + // This uses the pl_create_tempfifo function to create // the fifo in a safe manner by first creating a private // temporary directory. iodev->fileName = pl_create_tempfifo( (char **) &iodev->fileName, &dirname ); - if ( dirname == NULL || iodev->fileName == NULL ) + if ( dirname == NULL || iodev->fileName == NULL ) abort_session( pls, "mkfifo error" ); // Tell plframe widget to open FIFO (for reading). @@ -1556,7 +1556,7 @@ // Unlink FIFO so that it isn't left around if program crashes. // This also ensures no other program can mess with it. - if ( unlink( iodev->fileName) == -1 ) + if ( unlink( iodev->fileName ) == -1 ) abort_session( pls, "Error removing fifo" ); if ( rmdir( dirname ) == -1 ) abort_session( pls, "Error removing temporary directory" ); Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2013-11-18 21:45:22 UTC (rev 12713) +++ trunk/src/plstdio.c 2013-11-18 21:54:26 UTC (rev 12714) @@ -260,12 +260,12 @@ // pl_create_tempfifo() // // Securely create a temporary fifo and return the file name. -// This only works on POSIX compliant platforms at the moment. -// It creates a secure directory first using mkdtemp, then -// creates the named fifo in this directory. The combination of +// This only works on POSIX compliant platforms at the moment. +// It creates a secure directory first using mkdtemp, then +// creates the named fifo in this directory. The combination of // a private directory and mkfifo failing if the file name already exists // makes this secure against race conditions / DoS attacks. This function -// includes additional functionality over mkdtemp in that it honours the +// includes additional functionality over mkdtemp in that it honours the // TMP / TMPDIR / TEMP environment variables. // // The function returns the file name of the fifo. @@ -274,14 +274,14 @@ pl_create_tempfifo( char **p_fifoname, char **p_dirname ) { #if !defined PL_HAVE_MKDTEMP || !defined PL_HAVE_MKFIFO - plwarn("Creating fifos not supported on this platform"); + plwarn( "Creating fifos not supported on this platform" ); return NULL; -#else +#else FILE *fd; const char *tmpdir; - char *template; - char *dirname; - const char *tmpname = "plplot_dir_XXXXXX"; + char *template; + char *dirname; + const char *tmpname = "plplot_dir_XXXXXX"; const char *fifoname = "plplot_fifo"; int flags; @@ -316,11 +316,11 @@ #endif strcat( dirname, tmpname ); // Create the temporary directory - dirname = mkdtemp( dirname ); + dirname = mkdtemp( dirname ); *p_dirname = dirname; // Now create the fifo in the directory - template = (char *) malloc( sizeof ( char ) * ( strlen( tmpdir ) + strlen( tmpname ) + strlen(fifoname) + 4 ) ); + template = (char *) malloc( sizeof ( char ) * ( strlen( tmpdir ) + strlen( tmpname ) + strlen( fifoname ) + 4 ) ); strcpy( template, dirname ); #if defined ( MSDOS ) || defined ( WIN32 ) strcat( template, "\\" ); @@ -331,13 +331,14 @@ *p_fifoname = template; // Check that mkfifo succeeds safely - if ( mkfifo( template, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 ) { - plwarn( "mkfifo error" ); - free( template ); - *p_fifoname = NULL; - free( dirname ); - *p_dirname = NULL; - return NULL; + if ( mkfifo( template, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 ) + { + plwarn( "mkfifo error" ); + free( template ); + *p_fifoname = NULL; + free( dirname ); + *p_dirname = NULL; + return NULL; } return template; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |