MCPcopy Create free account
hub / github.com/NetHack/NetHack / convert_uchars

Function convert_uchars

sys/msdos/video.c:952–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

950}
951
952static int
953convert_uchars(char *bufp, /* current pointer */
954 uchar *list, /* return list */
955 int size)
956{
957 unsigned int num = 0;
958 int count = 0;
959
960 while (1) {
961 switch (*bufp) {
962 case ' ':
963 case '\0':
964 case '\t':
965 case '-':
966 case '\n':
967 if (num) {
968 list[count++] = num;
969 num = 0;
970 }
971 if ((count == size) || !*bufp)
972 return count;
973 bufp++;
974 break;
975
976 case '0':
977 case '1':
978 case '2':
979 case '3':
980 case '4':
981 case '5':
982 case '6':
983 case '7':
984 case '8':
985 case '9':
986 num = num * 10 + (*bufp - '0');
987 bufp++;
988 break;
989 return count;
990 }
991 }
992 /*NOTREACHED*/
993}
994
995#endif /* VIDEOSHADES */
996

Callers 1

assign_videocolorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected