~jsvoboda/helenos/dnsr

« back to all changes in this revision

Viewing changes to kernel/generic/src/console/kconsole.c

  • Committer: Jiri Svoboda
  • Date: 2013-04-19 18:38:18 UTC
  • mfrom: (1527.1.284 main-clone)
  • Revision ID: jiri@wiwaxia-20130419183818-nvfibuh4t5qol0e3
MergeĀ mainlineĀ chages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
523
523
        } else {
524
524
                /* It's a number - convert it */
525
525
                uint64_t value;
526
 
                int rc = str_uint64_t(text, NULL, 0, true, &value);
 
526
                char *end;
 
527
                int rc = str_uint64_t(text, &end, 0, false, &value);
 
528
                if (end != text + len)
 
529
                        rc = EINVAL;
527
530
                switch (rc) {
528
531
                case EINVAL:
529
 
                        printf("Invalid number.\n");
 
532
                        printf("Invalid number '%s'.\n", text);
530
533
                        return false;
531
534
                case EOVERFLOW:
532
 
                        printf("Integer overflow.\n");
 
535
                        printf("Integer overflow in '%s'.\n", text);
533
536
                        return false;
534
537
                case EOK:
535
538
                        *result = (sysarg_t) value;
537
540
                                *result = *((sysarg_t *) *result);
538
541
                        break;
539
542
                default:
540
 
                        printf("Unknown error.\n");
 
543
                        printf("Unknown error parsing '%s'.\n", text);
541
544
                        return false;
542
545
                }
543
546
        }