Re: [RFC v3 4/5] commands: add hwclock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 18, 2014 at 07:44:13AM +0200, Sascha Hauer wrote:
> On Tue, Jul 15, 2014 at 12:48:35AM +0400, Antony Pavlov wrote:
> > +{
> > +	struct rtc_device *r;
> > +	struct rtc_time tm;
> > +	struct rtc_time stm;
> > +	char rtc_name[16] = "rtc0";
> > +	char *env_name = NULL;
> > +	int opt;
> > +	int set = 0;
> > +
> > +	while ((opt = getopt(argc, argv, "f:s:e:")) > 0) {
> > +		switch (opt) {
> > +		case 'f':
> > +			strncpy(rtc_name, optarg, 16);
> > +			break;
> > +		case 's':
> > +			memset(&stm, 0, sizeof(stm));
> > +			parse_datestr(optarg, &stm);

The result value should really be checked.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux