Changeset ad2718d in mainline
- Timestamp:
- 2012-04-18T23:12:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 86e81a9
- Parents:
- 0885f7e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/date/date.c
r0885f7e rad2718d 194 194 } 195 195 196 /** Read the day, month and year from a string 197 * with the following format: DD/MM/YYYY 198 */ 196 199 static int 197 200 read_date_from_arg(char *wdate, struct tm *t) … … 199 202 int rc; 200 203 201 if (str_size(wdate) != 10) /* DD/MM/YYYY*/204 if (str_size(wdate) != 10) /* str_size("DD/MM/YYYY") == 10 */ 202 205 return EINVAL; 203 206 … … 221 224 } 222 225 226 /** Read the hours, minutes and seconds from a string 227 * with the following format: HH:MM:SS or HH:MM 228 */ 223 229 static int 224 230 read_time_from_arg(char *wtime, struct tm *t) … … 226 232 int rc; 227 233 size_t len = str_size(wtime); 228 bool sec_present = len > 5; 229 230 if (len > 8 || len < 5) /* HH:MM[:SS] */ 234 bool sec_present = len == 8; 235 236 /* str_size("HH:MM") == 5 */ 237 /* str_size("HH:MM:SS") == 8 */ 238 if (len != 8 && len != 5) 231 239 return EINVAL; 232 240
Note:
See TracChangeset
for help on using the changeset viewer.