int main() { char *s1 = "luoyang"; char *t1 = "ylh"; strcat1 (s1, t1); printf("%s and %s \n", s1, t1); return 0; }
int main(void) { $tainted char *x, *z, *a, *b, *e; char *y, *w, *c, *d, *f; char *a1 = strcat1(x, y); char *a2 = strcat2(w, z); strcat(a, c, e); strcat(d, b, f); }
main() { int i; char s[MAX] = "afeef "; char t[MAX] = "ebrahim"; strcat1(&s[0],&t[0]); for(i=0; s[i] != '\0';i++) printf("%c", s[i]); printf("\n"); return 0; }
main() { void strcat1(char s1[],char s2[]); char str1[50]; char str2[50]; printf("Кв╩С╚в┴йИШОоич┤«:\n"); scanf("%s",str1); scanf("%s",str2); strcat1(str1,str2); printf("л┬Ооич┤«: %s\n",str1); }
int main() { int len1,len2,first,c; char s1[MAXLINE]; char s2[MAXLINE]; first=1; while(1) { if(first != 1) { printf("\nDo you want to continue?(Y\\N)"); if(((c=getchar())== 'y') || (c=='Y')) { c=getchar(); printf("\nPlease enter first string\n"); len1=getlinee(s1, MAXLINE); printf("Please enter second string\n"); len2=getlinee(s2, MAXLINE); strcat1(s1,s2,len1,len2); printf("The resulting string is:\n%s", s1); } else if ((c=='n')||(c=='N')) break; else printf("I don't understand that command\n"); } else { printf("Please enter first string\n"); len1=getlinee(s1, MAXLINE); printf("Please enter second string\n"); len2=getlinee(s2, MAXLINE); strcat1(s1,s2,len1,len2); printf("The resulting string is:\n%s", s1); first=0; } } return 0; }
int ch4_string() { char *test=malloc(256); debugStr(utoa1(1132,test)); char *test2="abcdefg"; debugInt((int)strlen1(test2)); debugStr(strcat1(test,test2)); debugStr(strcpy1(test,test2)); debugInt(strend1(test,"g")); debugInt(strcmp1("1","2")); debugStr(strncpy1(test,"affgdtwsysgfdgfddsfad",2)); debugStr(strncat1(test,"ABCDEFG",4)); debugInt(strncmp1("12","12223",4)); system("PAUSE"); return 0; }
int main(int argc, char *argv[]) { const char *codeset = "UTF-8"; /* c must be int not char, because the value of KEY_RESIZE is 632. */ int c; char buf[BUFSIZ]; enum request request; request = REQ_VIEW_MAIN; struct view *view; size_t argv1_len; size_t argv2_len; size_t size; if (argc < 2) { printf("Usage: %s <dir/filename> <keyword>\n", argv[0]); return 0; } argv1_len = strlen(argv[1]); size = argv1_len + 3; char dest1[size]; strcat1(dest1, argv[1]); if (argc == 3) { argv2_len = strlen(argv[2]); size = argv2_len + 3; char dest2[size]; strcat1(dest2, argv[2]); snprintf(buf, sizeof(buf), FIND_CMDD, dest2, dest1); string_copy(fmt_cmd, buf); }else{ snprintf(buf, sizeof(buf), FIND_CMD, dest1); string_copy(fmt_cmd, buf); } signal(SIGINT, quit); if (setlocale(LC_ALL, "")) { codeset = nl_langinfo(CODESET); } if (*opt_encoding && strcmp(codeset, "UTF-8")) { opt_iconv_in = iconv_open("UTF-8", opt_encoding); if (opt_iconv_in == ICONV_NONE) die("Failed to initialize character set conversion"); } if (codeset && strcmp(codeset, "UTF-8")) { opt_iconv_out = iconv_open(codeset, "UTF-8"); if (opt_iconv_out == ICONV_NONE) die("Failed to initialize character set conversion"); } init(); #ifdef yaomoon fprintf(moon_log,"hello yaomoon\n"); fprintf(moon_log,"current_view=%d\n",current_view); #endif while (view_driver(display[current_view], request)) { int i; #ifdef yaomoon fprintf(moon_log,"321:while 1\n"); #endif foreach_view (view, i) update_view(view); #ifdef yaomoon while(1); #endif c = wgetch(status_win); request = get_request(c); if ( request == REQ_SCREEN_RESIZE) { #ifdef yaomoon fprintf(moon_log,"326:request == REQ_SCREEN_RESIZE\n"); #endif int height, width; getmaxyx(stdscr, height, width); wresize(status_win, 1, width); mvwin(status_win, height - 1, 0); wrefresh(status_win); } #ifdef yaomoon else fprintf(moon_log,"341:request != REQ_SCREEN_RESIZE\n"); #endif } quit(0); return 0; }