- snprintf ( fullname, sizeof ( fullname ), PND_DEVICE_POWER_BASE "/%s/enable", device );
- sprintf ( buffer, "%u", v );
+ while ( 1 ) {
+ if ( sscanf ( devices, "%99s", buffer ) != 1 ) {
+ break;
+ }
+
+ while ( isspace ( *devices ) )
+ devices++;
+ devices += strlen ( buffer );
+ snprintf ( fullname, sizeof ( fullname ), PND_DEVICE_POWER_BASE "/%s/enable", buffer );
+
+ sprintf ( buffer, "%u", v );
+ ret |= pnd_device_open_write_close ( fullname, buffer );
+ }